Skip to main content
In this recipe, you will configure ChatCLI to monitor a Kubernetes deployment and use AI to diagnose problems in real time.

Scenario

Production Application

Application β€œmyapp” running in production on Kubernetes

Quick Diagnosis

Team needs to diagnose problems quickly

AI-Powered Analysis

Use AI to analyze logs, events, and metrics

Automatic Context

Automatic K8s context in all queries

Option 1: Local Monitoring

Use this option when you have direct access to the cluster via kubectl.
1

Verify Cluster Access

2

Start the Watcher

You will see:
3

Ask Questions

4

Diagnose Problems

When something goes wrong:

Option 2: Server with Watcher (Team)

Use this option so the entire team has access to monitoring via a centralized server.
1

Deploy to Kubernetes

2

Team Connects

3

Automatic Context

Any question asked by any dev automatically includes K8s context:

Workflow: Production Incident

1

Alert Triggered

You receive an alert from Grafana/PagerDuty/Slack about deployment issues.
2

Connect to ChatCLI

3

Get an Overview

4

Investigate Root Cause

5

Receive Recommendations

6

Validate Resolution


Fine-Tuning Parameters

Collection Interval

Observation Window

Log Lines


One-Shot for Scripts and Alerts

Integrate ChatCLI with your alerting system:
Or via remote server:

Advanced Tips

Save project documentation as context and attach it when using the watcher:
Use multi-target mode to monitor everything in a single instance:
The AI receives detailed context from targets with issues and compact summaries from healthy ones, respecting the maxContextChars budget.
When metricsPort is configured, the watcher automatically scrapes the /metrics endpoint of the pods and includes the metrics in the analysis. Use metricsFilter with glob patterns to select only relevant metrics:

Option 3: Autonomous AIOps (Operator)

Use this option for automatic problem remediation without human intervention.
1

Install the Operator

2

Create Instance with Watcher

3

Monitor the Pipeline

4

Autonomous Flow in Action

When a pod starts crashing:
Everything happens automatically without human intervention. Auto-generated runbooks are reused for future occurrences of the same type. In agential mode, the AI acts as an autonomous agent with K8s β€œskills,” and upon resolving the issue, it generates a PostMortem CR with a complete timeline and a reusable Runbook for future occurrences.
5

(Optional) Add Runbooks

For specific scenarios where you want to control exactly what to do:
Remediation priority: Manual Runbook > Auto-generated Runbook > Agential remediation > Escalation. When there is no manual Runbook, the AI automatically generates a reusable Runbook CR. If neither a Runbook nor AI actions are available, the operator enters agential mode: the AI acts as an autonomous agent in an observe-decide-act loop, and upon resolution, it generates a PostMortem CR and a reusable Runbook.

Deployment Checklist

  • Verify cluster access (kubectl get pods)
  • Verify RBAC permissions for pods, logs, events
  • Choose mode: local (chatcli watch) or server (chatcli server)
  • Define targets: single (--deployment) or multi (--config targets.yaml)
  • (Optional) Configure metricsPort for Prometheus scraping
  • Configure appropriate interval and window for the scenario
  • Adjust maxContextChars if needed (default: 32000)
  • Test with a simple question: β€œIs the deployment healthy?”
  • (Optional) Integrate with alerts for automatic analysis
  • (Optional) Distribute access to the team via token