Know the blast radius before you deploy.
Kairo is an Apache-2.0 Kubernetes change-intelligence engine. It compares a cluster snapshot with proposed Kubernetes manifests, runs a deterministic capacity simulation, identifies high-risk object changes, and produces a machine-readable deployment verdict.
The repository is intentionally dependency-light: one Go binary serves the CLI, REST API and responsive web dashboard.
- Multi-document Kubernetes YAML and JSON ingestion.
- Node allocatable CPU, memory and
nvidia.com/gpucapacity modelling. - Existing bound Pod request accounting.
- Deployment, StatefulSet, DaemonSet, Pod, Job and KubeVirt
VirtualMachinerequest modelling. - Greedy pod-fit simulation with unschedulable-replica reporting.
- Workload restart/create estimates for changed manifests.
- PVC shrink detection.
- NetworkPolicy, CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy change warnings.
- Strict PodDisruptionBudget detection.
- ResourceQuota pressure checks.
- Blast-radius score, LOW/MEDIUM/HIGH level and SAFE/REVIEW/BLOCK verdict.
- CLI, JSON REST API and polished zero-build web UI.
- Docker image, health endpoint, GitHub Actions CI and unit/integration tests.
- Remote systemd deploy + smoke (
scripts/deploy-remote.sh).
Kairo is a pre-production decision aid, not a replacement for Kubernetes admission, the real scheduler, policy engines or progressive delivery. The in-repo YAML reader supports the common Kubernetes manifest subset and JSON; advanced YAML anchors/tags are intentionally not supported in this dependency-free release.
Requires Go 1.23+.
go run ./cmd/kairo serveOpen http://localhost:8080. The dashboard automatically loads and simulates the included production-risk demo.
Build a binary:
make build
./bin/kairo serveCross-compiles locally and installs Kairo as a systemd service over SSH (same pattern as Chimera/Scout):
# Explicit port (CLI flag)
./scripts/deploy-remote.sh 212.8.248.187 sus --port 19615
# Or via env
KAIRO_PORT=19615 ./scripts/deploy-remote.sh 212.8.248.187 sus
# Omit port → reuse .deploy-last PORT, else pick random 18000–28999
./scripts/deploy-remote.sh 212.8.248.187 sus
# Smoke (URL, --port, env, or .deploy-last)
KAIRO_URL=http://212.8.248.187:19615 ./scripts/smoke-remote.sh
./scripts/smoke-remote.sh --port 19615
# Remove
./scripts/deploy-remote.sh 212.8.248.187 sus --uninstall./bin/kairo plan \
-cluster examples/cluster.yaml \
-f examples/desired.yamlExit codes:
0: SAFE or REVIEW3: BLOCK1: parsing/runtime error2: invalid CLI usage
Machine-readable output:
./bin/kairo plan -cluster examples/cluster.yaml -f examples/desired.yaml -jsoncurl -s http://localhost:8080/healthzcurl -s http://localhost:8080/api/v1/simulate \
-H 'content-type: application/json' \
-d @request.jsonRequest shape:
{
"clusterYaml": "apiVersion: v1\nkind: Node\n...",
"desiredYaml": "apiVersion: apps/v1\nkind: Deployment\n..."
}For an initial snapshot, capture resources relevant to scheduling and change impact. Adapt the list to your environment and CRDs:
kubectl get nodes,pods,deployments,statefulsets,daemonsets,services,pvc,pdb,resourcequota,networkpolicy -A -o yaml > snapshot.jsonkubectl get ... -o yaml returns a List; the current dependency-light reader focuses on individual objects or JSON arrays. A production collector should normalize Lists into objects before the simulation engine.
docker build -t kairo:dev .
docker run --rm -p 8080:8080 kairo:devmake check
make test-e2eRepository layout:
cmd/kairo/ CLI + server entry point
internal/api/ REST API
internal/sim/ parser + deterministic simulation engine
internal/web/static/ embedded product dashboard
examples/ demo cluster + proposed manifests
docs/ architecture and security notes
scripts/ integration smoke test
.github/workflows/ CI
The core is deliberately small enough to open-source and extend. Production-grade follow-on adapters can add:
- Kubernetes discovery/collector and informer snapshots.
- Native kube-scheduler framework integration.
- Admission webhook dry-run replay.
- Cilium/PacketWolf observed-flow replay.
- CSI/storage topology and snapshot checks.
- GPU/NVLink/MIG topology modelling.
- KubeVirt migration/topology checks.
- GitHub/GitLab PR checks and Argo CD/Flux gates.
- Historical twins, drift and multi-cluster simulations.
See docs/ARCHITECTURE.md.