Chaos Engineering — Safe Setup
Fault injection can stop pods, change network behaviour or consume resources. This
page is the checklist to complete before the first experiment in a cluster, the
one-time confirmation the command line asks for, and the licence check that decides
who may start a run. For the faults, experiment options and reports see
Chaos Engineering.
Requirements
- A Kubernetes cluster you are allowed to disrupt, and a kubeconfig with access to
it. - The Reliability module in your licence. Without it the admin node refuses
chaos requests with403. - An infrastructure profile connected to that cluster — Chaos Engineering →
Infrastructure → Add Profile. - For
network_delay,network_loss,io_chaosandtime_chaos: Chaos Mesh
installed in the cluster. The other eight faults run on the plain Kubernetes API.
Before the first run
- Start in a staging cluster. Use a cluster or namespace whose outage nobody
will notice. - Narrow the target. Set a label selector or explicit pod names. An experiment
without either is rejected, because it would reach every pod in the namespace. - Deny the namespaces you must never touch —
kube-system, monitoring, the
ingress controller — in the profile’s denied namespaces. - Set the blast radius.
maxPodsAffected,blastRadiusPercentand
minReplicasAlivecap how much an experiment can take down. - Turn on auto-rollback and steady-state checks, so a failed check aborts the
experiment and reverts the faults. - Agree who approves a run. For shared clusters tick Require manual
approval: the experiment waits in Awaiting approval until an authorised
person presses Approve and records why it is safe. Unapprove puts it back
behind the gate as long as the run has not started. - Write down how you roll back if Mockarty itself is unreachable: the faults
are ordinary cluster objects (a network policy, a CoreDNS config map, a stress
pod, Chaos Mesh resources), so a cluster admin can remove them withkubectl.
The command-line confirmation
mockarty-cli refuses to send a fault-injecting command until you acknowledge what
it does. Two equivalent ways to acknowledge — choose per invocation or per CI job:
mockarty-cli chaos run \
--type pod_kill \
--k8s-namespace app \
--selector app=web \
--duration 5m \
--i-know-this-is-preview
export MOCKARTY_CHAOS_PREVIEW=1
mockarty-cli chaos run --type pod_kill --k8s-namespace app --selector app=web --duration 5m
--i-know-this-is-preview is a persistent flag on chaos: every subcommand
inherits it. The environment variable accepts 1, true, yes, on
(case-insensitive); anything else — including an empty value — does not count. The
CLI reads it on every invocation, so a value in your shell profile applies to the
whole session.
Gated commands: chaos run, chaos abort, chaos preset run, chaos cluster add,
chaos operator install, chaos operator uninstall, and the mutating cluster
commands chaos pods kill, chaos deployments scale, chaos deployments restart.
Read-only commands work without the acknowledgement, so you can always audit what
happened:
chaos list,chaos get <id>,chaos report <id>chaos preset list,chaos operator statuschaos cluster list,chaos cluster infochaos pods list|describe|logs,chaos deployments listchaos configmaps list|get,chaos services list,chaos events,chaos topologymockarty-cli tui chaos
Without the acknowledgement the command prints the opt-in banner and exits with
code 3. Licence refusals exit with 2, so a CI job can tell the two apart.
Licence and permissions
The command-line acknowledgement and the licence are independent checks:
| CLI acknowledgement | Reliability module | Result |
|---|---|---|
| no | yes or no | the CLI prints the opt-in banner and exits with 3 |
| yes | no | the admin node returns 403 — the module is not in the licence |
| yes | yes | the command runs |
Read-only commands skip the CLI acknowledgement and still respect the licence. If
the module is not in your licence, an administrator can add it.
Where to see the result
Open Chaos Engineering → Experiments for the run list and each experiment’s
timeline, Chaos Engineering → Reports to download a report (HTML, JSON, JUnit
or Allure), and Emergency Stop on the same page to abort every running
experiment.