KatalockAi AcademyBack to KatalockAi
Capstone 6, counts toward Phase 18

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.

about 30 h Earns its own certificate Reviewed against a 7-point rubric
Submit your project Get coached by Professor Katalock

The capstone and what it builds on

  1. 1DevOps Troubleshooting Agent for KubernetesThe capstone brief
  2. 2Tool Use and Function CallingPhase 14: Agent engineering
  3. 3Stateful Graph Orchestration - Durable Execution and CheckpointsPhase 14: Agent engineering
  4. 4Building an MCP Server: Stateless Python and TypeScriptPhase 13: Tools and protocols
  5. 5Human-in-the-Loop: Propose-Then-CommitPhase 15: Autonomous systems
  6. 6LLM Observability Stack SelectionPhase 17: Infrastructure and production
  7. 7SRE for AI - Multi-Agent Incident Response, Runbooks, Predictive DetectionPhase 17: Infrastructure and production
  8. 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

  1. 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).
  2. Alert receiver (FastAPI or similar) accepting Alertmanager (or PagerDuty-format) webhooks and extracting affected objects and the breach.
  3. 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.
  4. Root-cause agent with three steps: sample (last 15 minutes of telemetry for affected objects), walk (graph neighbours), hypothesize (ranked candidates).
  5. 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.
  6. Brief delivery to Slack (free workspace) or a local approval UI, offering at most one remediation action plus escalate and ignore.
  7. 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.
  8. Append-only JSONL audit log recording every candidate command as considered, executed, approved_by and outcome.
  9. 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 logs is 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 undo behind 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) and README.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.

CriterionWeightHow it's checked
Root-cause accuracy20Incident suite of 10 or more labelled scenarios with top-1 and top-3 accuracy reported from a script in the repo.
Safety20Read-only RBAC YAML; destructive server rejects calls without an approval token; audit log shows no destructive execution without approval.
Time-to-hypothesis10p50 time from webhook to brief measured across the suite.
Explainability15Every hypothesis carries a graph path and telemetry citations (queries or log selectors).
Integration completeness10Alert webhook to brief to approval to remediation works end to end, shown in evidence.
Code quality and structure10Graph, tools, agent and gate are separate components; tests cover the approval gate and scoring.
README: design decisions and limitations15README explains scoring, tool scoping and approval design, discusses misdiagnosed incidents from the learner's own run and states limits.

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.