Karakuri — User Guide¶
Karakuri is an AI-driven Kubernetes reliability agent that lives in Slack. It watches your clusters in real time, diagnoses problems with an LLM, and lets your team act — apply a fix, run diagnostics, or read a full incident report — all from an approval-gated Slack card. No dashboards to babysit; the cluster talks to you.
This guide walks an operator from zero to daily use.
1. What it does (the 10-second version)¶
┌── watch ──┐ ┌── diagnose ──┐ ┌──── act (Slack) ────┐
clusters │ pods, HPA │ → │ LLM root │ → │ Apply fix · Skip · │
│ ingress, │ │ cause + fix │ │ Investigate · │
│ nodes,svc │ │ + recommended │ │ Run diagnostics · │
└───────────┘ │ permanent fix │ │ Full report │
└───────────────┘ └──────────────────────┘
- Detects real problems: crashing/looping pods, image-pull errors, unschedulable pods, Services with no endpoints, unbound PVCs, NotReady nodes, stalled rollouts, HPAs that can't scale, ingresses pointing at missing backends.
- Diagnoses each with an LLM: a one-line root cause, a safe
kubectlfix when one exists, and a plain-language recommended permanent fix when it doesn't. - Acts only with a human in the loop — every fix is approval-gated, dry-run-previewed, signed, rate-limited, and audited.
2. How it talks to you — the alert card¶
When Karakuri finds a problem it posts one card to your alerts channel:
:mag: Pod health — api-7c9f (crashloop)
Cluster mg-dev-eks Namespace prod Pod api-7c9f
Reason CrashLoopBackOff Confidence 85%
Cause: the container OOMs on startup — memory limit (128Mi) is below its working set.
Suggested fix:
kubectl set resources deploy/api -n prod --limits=memory=512Mi
[✅ Apply fix] [⏭ Skip] [🔎 Investigate] [📄 Full report] ⋮
The card updates in place through its life — detected → fix applied → resolved — so the channel stays clean. Repeat alerts for the same workload collapse into the one card, and many resources with the same root cause (e.g. several ingresses missing one Service) collapse into a single card that lists all affected resources.
The buttons¶
| Button | What it does |
|---|---|
| ✅ Apply fix | Dry-runs the suggested kubectl command, then applies it (only shown when confidence is high enough and a safe fix exists). Result is posted + audited. |
| ⏭ Skip | Dismisses the card. Recorded to the learning loop. |
| 🔎 Investigate | Deeper read-only RCA — describe, recent logs, events — posted in the thread. |
| 🔎 Run diagnostics | When there's no auto-fix: runs the LLM's read-only probe commands and posts the output. |
| 📄 Full report | Generates a structured incident report — Issue · Root cause · Evidence · Recommended permanent fix · Verification — in the thread. |
| ⋮ overflow | Copy fix command · View raw logs · Mute this pod 1h. |
Every card always shows a recommended fix — even when there's no one-click command, you get exactly what to change and where (the Deployment / Helm value / manifest).
3. Talk to it directly¶
Mention the bot in any allowed channel:
@karakuri why is the api deployment in prod unhealthy?
@karakuri get pods -n prod (read-only kubectl, guardrailed)
It answers with cluster-aware RCA. Writes from chat are off by default and, when enabled, restricted to allowed users + confirmation.
4. Install (Helm)¶
Prereqs: a Slack app (bot + app token, Socket Mode), an LLM provider key, and a cluster
you can helm install into.
# 1. Create the secret (or use existingSecret)
kubectl create namespace karakuri
kubectl -n karakuri create secret generic karakuri-secrets \
--from-literal=SLACK_BOT_TOKEN=xoxb-... \
--from-literal=SLACK_APP_TOKEN=xapp-... \
--from-literal=BUTTON_SIGNING_SECRET=$(openssl rand -hex 32) \
--from-literal=OPENROUTER_API_KEY=...
# 2. Install with a values file (copy one from charts/karakuri/_example/)
helm upgrade --install karakuri ./charts/karakuri \
-n karakuri -f my-values.yaml
Pick the starting values file for your platform from charts/karakuri/_example/:
values-aws-eks.yaml, values-azure-aks.yaml, values-gcp-gke.yaml, values-k3s.yaml,
or the fully-annotated values-full-example.yaml. In-cluster ServiceAccount auth is the
default (no kubeconfig needed); the chart's ClusterRole grants the read access it needs.
Cluster key = the name on every card AND the guardrail allowlist. Name it what you want to see, e.g.
mg-dev-eks.
5. Configure¶
All non-secret config is one config: block in your values (see
configuration.md for the full reference). The essentials:
config:
slack:
audit_channel: "#karakuri-audit"
allowed_channels: ["#karakuri-alerts"] # where it listens + posts
allowed_users: [] # who may Apply/write (empty = any in channel)
llm:
provider: openrouter # groq | openrouter | openai | anthropic | bedrock
model: google/gemini-2.5-flash
clusters:
mg-dev-eks: # key = card label + allowlist
context: in-cluster
notify_channel: "#karakuri-alerts"
auto_watch: true
Guardrails (what it's allowed to run)¶
config:
guardrails:
dangerous_verbs: [exec, cp, port-forward, proxy, attach] # always blocked
extra_denied_verbs: [drain, cordon, taint] # add your own
block_secret_reads: true
block_namespace_delete: true
require_namespace_for_writes: true
Quieting expected false positives¶
config:
watcher:
# Ingress backends to skip (phantom/expected-absent). ssl-redirect = nginx/ALB
# redirect action. Add any Service created out-of-band by another chart/team.
ingress_ignore_backends: [ssl-redirect, mmp-backend]
ignore_namespaces: [kube-system, kube-public, kube-node-lease]
# Turn a whole analyzer off if it's noisy on a cluster:
check_ingress: true
check_hpa: true
# Jobs/CronJobs alert only when the Job fails (default). false = per-pod alerts.
check_jobs: true
Edit values → helm upgrade → done. No image rebuild for config changes.
One noisy CronJob or Job? No Karakuri change needed. The team that owns it adds an annotation to the CronJob (or standalone Job) itself:
or karakuri.clouddrove.com/ignore: "true" under the CronJob's own
metadata.annotations in its manifest. It takes effect within about a minute and
closes an open card. Remove it (... karakuri.clouddrove.com/ignore-) to hear about
failures again. See Usage: Jobs and CronJobs.
6. Reliability built in¶
- Single active instance by design (the chart refuses
replicaCount > 1); deploys useRecreateso two instances never double-post. - Survives restarts — open cards + dedup state persist (sqlite on a PVC, or Postgres), so after a redeploy Apply/Skip still work and you don't get a re-alert storm.
- Liveness probe restarts a wedged event loop, not just a dead process.
- Self-defending alerts — phantom backends (ssl-redirect), Job/CronJob pod churn, and same-cause storms are suppressed so the channel stays signal, not noise.
7. Observability¶
Prometheus metrics on :9090/metrics (port configurable). Enable the ServiceMonitor
and prometheusRule in values if you run Prometheus Operator. Shipped alerts:
- KarakuriDown — the agent stopped being scraped (dead-man's switch).
- KarakuriWatcherBlind — a watcher can't reach a cluster's API while the agent is up (catches "bot looks healthy but is monitoring nothing").
- KarakuriWatcherReconnecting — a watcher's stream is flapping.
- KarakuriDiagnosisErrors — the LLM/kubectl path is failing.
Every executed command is also posted to the audit channel.
8. Daily workflow (cheat sheet)¶
- Karakuri posts a card → read Cause + Suggested/recommended fix.
- Fix looks right + safe → Apply fix (dry-run preview runs first).
- Not sure → Investigate or Run diagnostics for live evidence.
- Need a write-up for a ticket / client → Full report.
- Expected/benign → Skip (or add to
ingress_ignore_backends/ mute if recurring). - Card resolves itself once the workload is healthy again.
9. Troubleshooting¶
See troubleshooting.md — covers blind watchers (TLS), stale-card button errors, and post-deploy alert storms. Common quick checks:
- Button says "cluster X not in allowlist" → the deployed
config.clusterskey must match the card's cluster.helm get values <release> -n <ns>to confirm. - Too many of one finding → add it to
ingress_ignore_backendsor turn off thatwatcher.check_*. - No alerts at all → check
KarakuriWatcherBlind/ the startupUNREACHABLElog line.