myapp in the namespace production, in three setups:
Option 1: local monitoring
1
Check cluster access
~/.kube/config with its current context (or --kubeconfig); it does not read KUBECONFIG.2
Start the watcher
3
Ask
/watch status prints the one-line state.Tune it
Several workloads, other kinds, Prometheus metrics
maxContextChars. Prometheus scraping reads pod IPs over plain HTTP, so from a laptop it only works if your network routes to pod IPs; otherwise the other data still flows and the metrics section is simply absent.
One-shot for alert handlers
Option 2: team server with a watcher (Helm)
1
Install the server with a watcher
server.tokenis required: in a pod the server listens on every interface and refuses to start without a credential.- The server log reaches
kubectl logson its own: in a pod the server also writes it to stderr as JSON lines. The file copy in the pod rotates at 20 MB with 3 backups (logging.*), which fits the pod’s 200Mi data volume. - An empty
watcher.namespacewatchesdefault. A namespace other than the release’s (productionhere, outsidemonitoring) makes the chart create a ClusterRole automatically. For several workloads, or a StatefulSet, DaemonSet, Job or CronJob (kind), usewatcher.targetsin a values file (see Helm watcher values).
2
Check it
3
Connect
CHATCLI_ALLOW_INSECURE=true is needed because this server is plaintext; for anything beyond a port-forward turn on TLS and connect with --tls --ca-cert.security.jwtSecretRef), so each caller has its own identity and rate-limit bucket; see Server authentication.
Incident workflow
watcher.window (default 2 hours). /watch status in this session queries the server’s watcher (K8s Watcher (remote): …).
For scripts against the server:
Option 3: autonomous AIOps (operator)
The operator provisions the server from anInstance, reads the watcher’s alerts over StreamAlerts, and drives Anomaly → Issue → AIInsight → RemediationPlan. It dials the server over TLS with a credential, so the Instance needs both.
1
Install the operator
2
Create the Secrets
Follow Your first Instance for the three Secrets in the namespace
chatcli: chatcli-api-keys (provider key), chatcli-server-token (key token) and chatcli-tls (tls.crt, tls.key, ca.crt, valid for chatcli.chatcli.svc.cluster.local).3
Create the Instance with a watcher
server.token (or another credential) the operator does not create the Deployment (AuthenticationConfigured=False); without TLS it cannot reach the server (ServerReachable=False). namespace is required on every target. The pipeline uses the first ready Instance in the cluster.4
Follow the pipeline
HighRestartCount (and OOMKilled when that is the cause); the operator records an Anomaly, correlates it into an Issue, asks the server for an analysis (AnalyzeIssue), and remediates from a matching Runbook, AI-suggested actions, or an agentic observe-decide-act loop (AgenticStep, up to spec.aiops.agenticMaxSteps, default 10). The full flow, approvals and safety limits are in AIOps Platform.5
(Optional) Add a Runbook
Troubleshooting
Checklist
- Watch and server
- AIOps operator
-
kubectlaccess and RBAC for pods, pods/log, events, workloads - Local (
chatcli watch) or shared (chatcli server/ Helmwatcher.*) - Single target (
--deployment) ortargets.yaml(--config/--watch-config) - Optional
metricsPortandmetricsFilterfor Prometheus scraping - Interval and window fit the scenario;
maxContextCharsfor many targets - Server: credential set, TLS before exposing it
- Test: “Is the deployment healthy?”