Setup¶
Get Karakuri running and talking to Slack + your cluster.
Prerequisites¶
- Docker + Docker Compose
- A Kubernetes cluster and a kubeconfig context (EKS / GKE / AKS / kind / k3s / on-prem)
- A Slack workspace where you can create an app
- An API key for one LLM provider (OpenRouter, Groq, or OpenAI)
1. Create the Slack app¶
Quick path — from the app manifest (recommended)¶
Every scope, event, and setting is pre-wired below (Socket Mode, interactivity, the five bot scopes). One paste instead of a dozen toggles:
- Go to https://api.slack.com/apps → Create New App → From an app manifest.
- Pick your workspace → choose YAML → paste the manifest below → Create.
- Socket Mode is already on; Basic Information → App-Level Tokens →
Generate Token and Scopes → add scope
connections:write→ copy thexapp-…token. (App-level tokens can't live in a manifest — this one step is manual.) - Install to Workspace → copy the Bot Token (
xoxb-…). - (branding, optional) Basic Information → Display Information → App icon →
upload
slack-app-icon.pngso alerts post under the Karakuri mark. (App icons can't live in a manifest.)
Use the copy button in the top-right of the block — no need to leave this page.
_metadata:
major_version: 1
minor_version: 1
display_information:
name: Karakuri
description: Open-source Kubernetes crash-diagnosis and auto-remediation bot.
background_color: "#282628"
long_description: >-
Karakuri watches your Kubernetes clusters in real time (no Prometheus
required), diagnoses crashes (CrashLoopBackOff, OOMKilled, ImagePullBackOff,
Services with no endpoints) with an LLM, and posts a one-click, guard-railed
kubectl fix to Slack — dry-run previewed, signed, audited, then verified once
the workload is healthy. https://github.com/clouddrove/karakuri
features:
bot_user:
display_name: Karakuri
always_online: true
oauth_config:
scopes:
bot:
- app_mentions:read # @Karakuri mentions / threaded follow-ups
- chat:write # post + update + delete alert cards
- channels:read # resolve public channel names
- groups:read # resolve private channel names
- im:write # open DMs for confirmations
settings:
event_subscriptions:
bot_events:
- app_mention
interactivity:
is_enabled: true # Apply / Skip / Investigate buttons + modals
org_deploy_enabled: false
socket_mode_enabled: true # no public request URL needed
token_rotation_enabled: false
Prefer a file? Download the raw manifest, or grab it from the repo root after cloning. It is the same file this page embeds, so the two cannot drift apart.
That gives you both tokens for step 3 below. Skip to Get an LLM provider key.
Manual path — from scratch¶
At https://api.slack.com/apps → Create New App → From scratch.
- Socket Mode: enable → generate an App-Level Token (
xapp-…, scopeconnections:write) - OAuth & Permissions → Bot Token Scopes:
app_mentions:read,chat:write,channels:read,groups:read,im:write - Event Subscriptions: enable → subscribe to bot event
app_mention - Interactivity & Shortcuts: enable (required for the Apply/Skip/Investigate buttons)
- Install to Workspace → copy the Bot Token (
xoxb-…)
2. Get an LLM provider key¶
Karakuri's provider is pluggable (llm.provider in config.yaml):
- OpenRouter (default): https://openrouter.ai/keys →
OPENROUTER_API_KEY - Groq: https://console.groq.com/keys →
GROQ_API_KEY - OpenAI: https://platform.openai.com/api-keys →
OPENAI_API_KEY - Anthropic (Claude): https://console.anthropic.com/ →
ANTHROPIC_API_KEY(model e.g.claude-sonnet-4-6) - AWS Bedrock (Claude): no key — uses the AWS credential chain (IRSA on EKS); set
llm.region+ a Bedrock model id - Azure OpenAI (
provider: azure): setllm.base_url(Azure resource endpoint),llm.deployment(deployment name), optionalllm.api_version; key inAZURE_OPENAI_API_KEY - GCP Vertex AI / Gemini (
provider: vertex): no key — IAM via ADC / Workload Identity on GKE; setllm.project(+ optionalllm.location, defaultus-central1); model e.g.gemini-2.0-flash - Any OpenAI-compatible endpoint (
provider: openai_compatible) — DeepSeek, Together, Fireworks, Mistral, vLLM, LM Studio, …: setllm.base_url(e.g.https://api.deepseek.com/v1) +OPENAI_COMPATIBLE_API_KEY(omit for keyless self-hosted)
Want a model not listed? Two no-friction paths: route it through OpenRouter (one key, 200+ models incl. DeepSeek), or point
openai_compatibleat its base URL.
3. Configure secrets (.env)¶
Fill in:
- SLACK_BOT_TOKEN (xoxb-…), SLACK_APP_TOKEN (xapp-…)
- the provider key from step 2
- BUTTON_SIGNING_SECRET — generate one:
.env is gitignored. Never commit real tokens (CI runs gitleaks to enforce this).
4. Configure clusters (config.yaml)¶
Edit:
- clusters.<name>.context → a name from kubectl config get-contexts
- slack.allowed_channels → channels Karakuri listens in
- slack.allowed_users → who may click Apply fix
- clusters.<name>.notify_channel → where restart alerts post
See Configuration for every key.
Multiple clusters¶
Add a block per cluster under clusters: (each with its own context +
notify_channel). Make every context reachable inside the container:
# docker-compose.yml — merge kubeconfigs into KUBECONFIG (colon-separated)
environment:
KUBECONFIG: /home/agent/.kube/config-a:/home/agent/.kube/config-b
- Context names must be unique across the merged kubeconfigs (
kubectl config get-contexts). - Use static/token or client-cert kubeconfigs — cloud exec-plugin auth
(
gke-gcloud-auth-plugin,aws) won't run inside the container; mint a ServiceAccount-token kubeconfig per cluster instead. - Local kind/k3s servers must use
host.docker.internal, not127.0.0.1. - Each cluster's RBAC needs read + the write verbs Karakuri applies (the Helm chart's ClusterRole covers this in-cluster).
5. Invite the bot¶
Invite the Slack bot user to every channel referenced in slack.audit_channel,
slack.allowed_channels, and each cluster's notify_channel.
6. Run¶
Then in Slack:
@karakuri selftest checks cluster reachability, LLM ping, Slack auth, backend,
and audit-channel write — the fastest confirmation everything is wired.
Next: Usage.