Deployment#
rackattack ships as a CGO-free static binary on debian:bookworm-slim with
graphviz installed (the blast-radius renderer shells out to dot). The
Kubernetes manifests in
deploy/k8s/ are a
kustomize base + overlay: base/ runs a single-node CockroachDB StatefulSet plus
the rackattack Deployment (dev/evaluation), and production/ layers secrets and
auth on top.
The service is configured entirely through environment variables — see the Configuration reference for every setting and its default.
What’s deployed#
- StatefulSet
crdb+ a headless Service — CockroachDB runningstart-single-node --insecure(dev only). - Deployment
rackattack— init containers create the database and apply migrations beforeservestarts; the Service exposes gRPC:8080and REST:8081.
Local validation on k3d#
./scripts/k3d-up.sh # build image, create cluster, import image, apply, wait green
./scripts/k3d-down.sh # delete the clusterk3d-up.sh builds the image (if missing), creates the cluster, imports the local
image, kubectl apply -k deploy/k8s/base, then waits on rollout status for the
StatefulSet and Deployment. Reach the service with:
kubectl port-forward svc/rackattack 8081:8081 # REST
kubectl exec deploy/rackattack -- rackattack fleet new --sites 1See deploy/README.md
for details.
Operations#
The deployed service carries the operational surface documented elsewhere:
- Health probes —
serveexposes HTTP/healthz(process liveness, never touches the DB) and/readyz(readiness: DB reachable and schema migrated), plus the standard gRPCgrpc_health_v1service whose status tracks the same readiness check. Both HTTP endpoints sit outside auth. The k8s Deployment points its liveness probe at/healthzand its readiness probe at/readyz, so traffic is gated until the database is up and migrated, while a transient DB blip won’t restart otherwise-healthy pods. - Observability —
/metricsfor Prometheus (the pod template has scrape annotations), example alert rules, a Grafana dashboard, and OpenTelemetry tracing viaOTEL_EXPORTER_OTLP_ENDPOINT. - Audit & CDC — set
AUDIT_CHANGEFEED=true(or applydeploy/changefeed.sqlfor the native webhook sink) to capture mutations. - Security & auth — set
AUTH_ENABLED=truewith a key source to require OIDC/JWT tokens. - Caching — point
REDIS_ADDRat a shared Redis for multi-replica cache coherence.
CI/CD builds the image on every push and pushes to GHCR on a v* tag; see
deploy/README.md.
Production notes#
The base/ topology is for dev/evaluation. The
production/
overlay adds the config & secrets posture: all secrets (DB connection string
with a non-root SQL user, OIDC/JWKS, REDIS_ADDR, the audit-webhook secret) come
from a Secret, auth is enforced, and RACKATTACK_ENV=production turns on the
boot guardrail. See deploy/README.md.
Still to layer on for a full production deployment: secure replicated CockroachDB (certs), resource requests/limits + HA tuning, an Ingress/Gateway with TLS and a gRPC route, and a NetworkPolicy.