Running Your First Experiment

End-to-end flow after the stack is up: from logging in to a running chaos experiment with a certification report. Applies to all three routes — the only difference is which cluster the infrastructure YAML is applied to.

The control plane is based on Litmus ChaosCenter 3.x, so the UI uses Litmus terminology: Environments → Chaos Infrastructures → Chaos Experiments.


The big picture

1
Already done by ./scripts/setup.sh --deploy — it creates the ace-local environment, registers the ace-local chaos infrastructure (cluster scope, namespace litmus), installs its subscriber, and waits until it is CONNECTED.
2
Create a Chaos Experiment — pick an application, an agent and faults, and complete each fault's target. Save and Run reject combinations the local catalogs do not support.
3
Run it — watch the live execution graph in the UI or via kubectl -n litmus get pods -w. Cleanup always runs at the end (Argo onExit), even when a step fails.
4
Results → Langfuse → Certification — traces land in Langfuse; the Certifier produces one result per injected fault and a 12-section report.

0. Before You Start

Pre-flight checklist Stack is healthy: kubectl get pods -n ace shows all pods Running.
Chaos infrastructure is up: kubectl get pods -n litmus shows subscriber, chaos-operator, workflow-controller and event-tracker Running, and the UI's Environments → ace-local page shows ace-local as CONNECTED.
UI is reachable at the URL setup.sh printed (default http://localhost:2001) — log in with ADMIN_USERNAME / ADMIN_PASSWORD (default admin / litmus).
kubectl config current-context is kind-agentcert-<ACE_INSTANCE_NAME> (see KIND_CLUSTER_NAME in .env).

If setup printed “Chaos infrastructure is NOT connected”, fix the warning it showed and re-run ./scripts/setup.sh --restart — registration is idempotent and reuses the existing infrastructure.


Connecting a chaos infrastructure by hand (fallback)

Only needed when you set ACE_AUTO_REGISTER_INFRA=false in .env, or want an extra infrastructure on another cluster.

  1. In the UI open Environments → New Environment, give it a name and type (Non-Production).
  2. Open it → Enable Chaos → Kubernetes; pick Cluster-wide scope and keep the litmus namespace / service account.
  3. Apply the manifest the UI shows (kubectl apply -f "<url-shown-in-the-ui>", or download it and kubectl apply -f the file).
  4. Watch it come up (kubectl -n litmus get pods -w) and wait for CONNECTED / ACTIVE in the UI; if it stays DISCONNECTED, work through the networking checklist below.
  5. Re-run ./scripts/setup.sh --restart so the subscriber secret and workflow-controller instanceID are synced to it.

Networking Checklist (Pods → Control Plane)

In the Kubernetes setup, the control plane (graphql, auth, etc.) runs inside the same cluster as the infra subscriber — so pods reach graphql via Kubernetes DNS, not the host IP. The SERVER_ADDR and SUBSCRIBER_CALLBACK_URL in .env are patched to http://graphql.ace.svc.cluster.local:8081 by scripts/setup.sh.

If the subscriber still can’t connect:

⚠ Common failure modes 1. Graphql pod not running. kubectl get pods -n ace -l app=graphql — must show Running.

2. Wrong SERVER_ADDR in .env. Check grep SERVER_ADDR .env — should be http://graphql.ace.svc.cluster.local:8081/query, not a host IP.
Re-run ./scripts/setup.sh --deploy to patch and redeploy.

3. Subscriber in wrong namespace. Cross-namespace DNS works fine (service.namespace.svc.cluster.local). The subscriber in litmus can reach graphql.ace.svc.cluster.local without any extra config.

Quick reachability test from inside the litmus namespace:

kubectl run -i --rm --restart=Never reach-test -n litmus --image=busybox --command -- \
  sh -c 'wget -q -T 3 -O- http://graphql.ace.svc.cluster.local:8081/query --post-data={} --header=Content-Type:application/json'
# reached & rejected empty body = OK; timeout = DNS or pod not running

RBAC for App Installs

App charts (e.g. sock-shop with monitoring) ship their own ClusterRole/Role objects. The infra-cluster-role in the latest infra manifest includes these RBAC permissions — so a freshly connected infrastructure handles this automatically.

Fallback Only needed if your infra was connected before this fix and you see clusterroles.rbac.authorization.k8s.io ... is forbidden. Grant it once (after the litmus namespace exists) — or simply re-connect the infrastructure:
kubectl --context kind-agentcert create clusterrolebinding argo-chaos-admin \
  --clusterrole=cluster-admin --serviceaccount=litmus:argo-chaos

Verify existing bindings:

kubectl get clusterrolebinding -o json \
  | jq -r '.items[] | select(.subjects[]?.name=="argo-chaos") | "\(.metadata.name) → \(.roleRef.name)"'

1. Create a Chaos Experiment

  1. Open Chaos Experiments → New Experiment.
  2. Select the ace-local environment and the ace-local chaos infrastructure (created by setup.sh).
  3. Choose a fault from the default ChaosHub — it is served from this checkout’s chaos-charts/ (baked into the hub bundle image at setup), never cloned at runtime. Start simple — e.g. pod-delete against a target deployment.
  4. Define the target (namespace / app label / deployment). A newly added fault is only committed to the experiment when you click Apply with a complete target; Save and Run are blocked while any fault is incomplete.
  5. (Optional but recommended) Add Resilience Probes — the steady-state checks (HTTP/cmd/prometheus) that decide whether the system stayed healthy.
  6. Tune the fault parameters (duration, chaos interval, etc.).
  7. Save / Run the experiment.

2. Watch the Run

In the UI, open the experiment’s run to see the live execution graph (install → inject fault → probes → cleanup).

kubectl -n litmus get pods           # runner / experiment pods appear
kubectl -n <target-ns> get pods -w   # watch the fault take effect

3. Results → Langfuse → Certification

What Where Notes
Pass/Fail + score Experiment run in UI Based on your Resilience Probes
Agent traces Langfuse :4002 → project agentcert Every LLM call the agent made under fault
Certification report Certifier :18000/docs POST the Langfuse trace → get a 12-section JSON+PDF report

The scripts/run_certification.py helper wraps the Certifier API calls for you.


Troubleshooting

Symptom Likely cause Fix
Experiment create: failed RBAC preflight: unable to load in-cluster configuration graphql can’t reach the K8s API Check kubectl logs -n ace deploy/graphql — the graphql pod uses its ServiceAccount token for in-cluster auth
Infra stuck DISCONNECTED; subscriber log: dial tcp [::1]:8081: connection refused Subscriber can’t reach graphql The infra YAML uses graphql.ace.svc.cluster.local:8081 as the callback — verify graphql pod is Running
Subscriber log: dial tcp 172.26.0.1:8081: i/o timeout UFW dropping the port sudo ufw allow from 172.26.0.0/16 to any port 8081 proto tcp
Subscriber log: websocket: bad handshake ALLOWED_ORIGINS regex mismatch Widen ALLOWED_ORIGINS in .env to include 172.* / 10.* ranges, restart graphql
App install fails: clusterroles ... 'prometheus' is forbidden chaos SA lacks RBAC perms Apply the argo-chaos-admin binding shown above
Login fails invalid_credentials admin row predates current .env Delete admin user from MongoDB, then kubectl rollout restart -n ace deploy/auth
Langfuse UI 500 on first boot init password < 8 chars Set LANGFUSE_INIT_USER_PASSWORD (≥ 8 chars) and recreate langfuse-web

ACE — Agent Certification Engine · Released under the Apache License 2.0.