Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Container Deployment Quickstart

Operator quickstart for image-first AngaraBase startup:

  • local docker run with a cgroup-aware startup probe;
  • minimal k8s deployment (single-node, without HA);
  • smoke checks for readiness and basic diagnostics.

0) 30-second evaluator path (image-only)

If you need a quick evaluator/DPP smoke without a Rust toolchain:

tools/compat_suite/image_smoke.sh

The script starts a container from the canonical Dockerfile, waits for /health/ready, checks the startup log (deployment probe resolved effective budgets, cgroup_version), and verifies probe metrics in /metrics.

1) Local container smoke (docker run)

Build the image:

docker build -t angarabase:local .

Run with a memory limit (probe contract):

docker run --rm --name angarabase-local \
  --memory=512m \
  -e ANGARABASE_DEPLOYMENT_PROFILE=container \
  -p 5152:5152 \
  -p 9898:9898 \
  angarabase:local

Expected signal in logs:

  • the deployment probe resolved effective budgets line is present;
  • deployment_profile=container;
  • memory_source/cpu_source reflect cgroup_v1 or cgroup_v2 (or proc_fallback with fallback_reason).

Check readiness in the container:

curl -fsS http://127.0.0.1:9898/health/ready

The container HEALTHCHECK uses the same endpoint, so it becomes green only after health_readiness_reason_v0() passes.

Check metrics:

curl -fsS http://127.0.0.1:9898/metrics | rg "deployment_probe|deployment_profile"

2) Resource-limit examples

CPU + memory cap:

docker run --rm --name angarabase-capped \
  --memory=1g \
  --cpus=1.5 \
  -e ANGARABASE_DEPLOYMENT_PROFILE=container \
  -p 5152:5152 \
  -p 9898:9898 \
  angarabase:local

Explicit override (the probe must not overwrite it):

docker run --rm \
  --memory=512m \
  -e ANGARABASE_DEPLOYMENT_PROFILE=container \
  -e ANGARABASE_MEMORY_BUDGET=256MB \
  -e ANGARABASE_CPU_BUDGET=1000m \
  -p 5152:5152 \
  -p 9898:9898 \
  angarabase:local

Expected: the budget source in metrics/logs becomes config_override.

3) Kubernetes minimal smoke

Apply manifests:

kubectl apply -f tools/deploy/kubernetes/minimal/namespace.yaml
kubectl apply -f tools/deploy/kubernetes/minimal/configmap.yaml
kubectl apply -f tools/deploy/kubernetes/minimal/service.yaml
kubectl apply -f tools/deploy/kubernetes/minimal/statefulset.yaml

Verify:

kubectl -n angarabase get pods
kubectl -n angarabase get svc angarabase
kubectl -n angarabase logs statefulset/angarabase
kubectl -n angarabase get statefulset angarabase -o yaml | rg "resources:|health/"

Important: resources.requests/limits are set in statefulset.yaml. If limits are removed, the probe may see “unlimited” and switch to a host-level fallback for budgets.

Delete:

kubectl delete namespace angarabase

4) Diagnostics and backup entrypoints

For the packaged/operator path, use angara-cli instead of direct tools/... calls:

angara-cli diagnostics bundle --root artifacts/diagnostics/container-smoke --json
angara-cli backup full --config /etc/angarabase/angarabase.conf --out /tmp/base_full.abk

Related runbooks:

DPP alignment:

  • for resource-limit safety rails and fail-closed mode, see business_strategy/PILOT_CHECKLIST.md (§5 and §6).