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.

Kubernetes topology (validated locally on k3d)
Kubernetes topology (validated locally on k3d)

What’s deployed#

  • StatefulSet crdb + a headless Service — CockroachDB running start-single-node --insecure (dev only).
  • Deployment rackattack — init containers create the database and apply migrations before serve starts; the Service exposes gRPC :8080 and 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 cluster

k3d-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 1

See deploy/README.md for details.

Operations#

The deployed service carries the operational surface documented elsewhere:

  • Health probesserve exposes HTTP /healthz (process liveness, never touches the DB) and /readyz (readiness: DB reachable and schema migrated), plus the standard gRPC grpc_health_v1 service whose status tracks the same readiness check. Both HTTP endpoints sit outside auth. The k8s Deployment points its liveness probe at /healthz and 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/metrics for Prometheus (the pod template has scrape annotations), example alert rules, a Grafana dashboard, and OpenTelemetry tracing via OTEL_EXPORTER_OTLP_ENDPOINT.
  • Audit & CDC — set AUDIT_CHANGEFEED=true (or apply deploy/changefeed.sql for the native webhook sink) to capture mutations.
  • Security & auth — set AUTH_ENABLED=true with a key source to require OIDC/JWT tokens.
  • Caching — point REDIS_ADDR at 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.