DevOps troubleshooting agent for Kubernetes
Build a read-only-by-default Kubernetes incident agent that walks a cluster graph, ranks root-cause hypotheses with telemetry citations and gates every remediation behind human approval.
The capstone and what it builds on
- 1DevOps Troubleshooting Agent for KubernetesThe capstone brief
- 2Tool Use and Function CallingPhase 14: Agent engineering
- 3Stateful Graph Orchestration - Durable Execution and CheckpointsPhase 14: Agent engineering
- 4Building an MCP Server: Stateless Python and TypeScriptPhase 13: Tools and protocols
- 5Human-in-the-Loop: Propose-Then-CommitPhase 15: Autonomous systems
- 6LLM Observability Stack SelectionPhase 17: Infrastructure and production
- 7SRE for AI - Multi-Agent Incident Response, Runbooks, Predictive DetectionPhase 17: Infrastructure and production
- 8Security - Secrets, API Key Rotation, Audit Logs, GuardrailsPhase 17: Infrastructure and production
What You'll Build
An SRE agent for a Kubernetes cluster. An alert webhook triggers it; it walks a graph of cluster objects and telemetry, drafts ranked root-cause hypotheses with graph paths and metric or log citations, and posts a brief with approval buttons. Read-only tools by default; destructive actions live on a separate server that only works after a human approves, and every considered command is audited.
Requirements
- Graph ingestion: sync cluster state into a graph (kuzu, Neo4j or networkx) on a schedule. Nodes include Pod, Deployment, ReplicaSet, Node, Service, PVC, HPA; edges include OWNEDBY, SCHEDULEDON, EXPOSES, MOUNTS, SCALES and OBSERVED_BY (telemetry series).
- Alert receiver (FastAPI or similar) accepting Alertmanager (or PagerDuty-format) webhooks and extracting affected objects and the breach.
- Read-only tool server (MCP recommended) wrapping get, list, describe, logs, PromQL and LogQL queries only. The agent's service account has a read-only RBAC Role; include the YAML.
- Root-cause agent with three steps: sample (last 15 minutes of telemetry for affected objects), walk (graph neighbours), hypothesize (ranked candidates).
- Evidence scoring: score = recency x specificity x inverse graph-path length x citation count (or a documented variant); return the top 3, each with its graph path and telemetry citations.
- Brief delivery to Slack (free workspace) or a local approval UI, offering at most one remediation action plus escalate and ignore.
- Remediation gate: destructive tools (scale, rollback, delete) on a second server that rejects calls without an approval token minted only by the human approval action.
- Append-only JSONL audit log recording every candidate command as considered, executed, approved_by and outcome.
- Synthetic incident suite of at least 10 scripted scenarios (for example OOMKill, bad ConfigMap rollout, image-pull backoff, failing readiness probe, PVC full, HPA thrash, DNS failure) with ground-truth labels. Report top-1 and top-3 root-cause accuracy and time-to-hypothesis p50.
Constraints
- Model-agnostic: any OpenAI-compatible endpoint (including the KatalockAi API) or a local model (for example via Ollama, llama.cpp or vLLM) may be used. No named commercial model is required; record which model you used in the README.
- Hardware: a laptop with 8 GB or more RAM running kind, k3d or minikube, plus Prometheus (kube-prometheus-stack) is enough. Loki and Tempo are optional;
kubectl logsis an accepted log source. - Substitution: the lesson uses 20 incidents, PagerDuty, Slack, ArgoCD and a comparison with a commercial agent. Here 10 or more scripted incidents, Alertmanager webhooks, Slack or a local approval UI and
kubectl rollout undobehind the approval gate (ArgoCD optional) are accepted. - Never give the agent cluster-admin credentials; the read-only Role must be what the agent actually runs with.
Stretch Goals
- Add a near-miss report that flags any considered destructive command that would have run without approval.
- Train a small classifier that separates correlated spikes from true root causes on your incident labels.
- Dry-run the rollback against a staging namespace before the approval button appears.
How to Submit
- Public GitHub repo with
graph/,receiver/,tools_readonly/,tools_destructive/,agent/,incidents/(injection scripts and labels),audit/(sample log),k8s/(RBAC YAML) andREADME.md. - README: cluster setup steps, how to inject an incident and watch the agent respond, the incident results table, the safety model and limitations.
- Paste the incident results table, one full brief with graph path and citations, and an excerpt of the audit log including an approved and a declined action.
How It's Reviewed
Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.
Submit
Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.
- Incident results table (scenario, true cause, top-3 hypotheses, correct or not, time-to-hypothesis)
- One complete brief with graph path, telemetry citations and approval buttons
- Audit log excerpt showing considered vs executed commands and approver
- Output of an attempt to call a destructive tool without approval (rejected)
- Short reflection on the incident type the agent handled worst
Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.