Skip to main content

BlastRadiusPolicy

BlastRadiusPolicy is a cluster-scoped guardrail that limits what chaos experiments can do. It evaluates in a 7-step chain before any experiment runs.

Group: chaos.chaosplane.io/v1alpha1
Kind: BlastRadiusPolicy
Scope: Cluster

Example

apiVersion: chaos.chaosplane.io/v1alpha1
kind: BlastRadiusPolicy
metadata:
name: production-guardrails
spec:
enforcement: Enforce

scope:
namespaces:
- production
labelSelector:
matchLabels:
environment: production

targetLimits:
maxTargets: 2
maxPercentage: 20

protectedResources:
namespaces:
- kube-system
- monitoring
labels:
chaosplane.io/protected: "true"
names:
- kind: Deployment
name: payment-service
namespace: production

actionLimits:
allowedActions:
- pod-kill
- network-delay
- pod-cpu-stress
maxDuration: 10m

timeWindows:
allowed:
- name: business-hours
schedule: "0 9 * * 1-5"
duration: 8h
timezone: UTC
blocked:
- name: peak-traffic
schedule: "0 17 * * 1-5"
duration: 3h
timezone: America/New_York

Spec fields

spec.enforcement

ValueDescription
EnforceBlock experiments that violate the policy
AuditLog violations but allow experiments to proceed

spec.scope

Defines which experiments this policy applies to. A policy only evaluates experiments targeting resources within its scope.

FieldTypeRequiredDescription
namespaces[]stringNoNamespaces this policy covers (empty = all)
labelSelectorLabelSelectorNoLabel selector for target resources

spec.targetLimits

Limits how many resources a single experiment can affect.

FieldTypeRequiredDescription
maxTargetsint32NoAbsolute maximum number of targets
maxPercentageint32NoMaximum percentage of matching resources (0-100)

Both limits are evaluated independently. The experiment is blocked if it would exceed either one.

spec.protectedResources

Resources that can never be targeted, regardless of the experiment spec.

FieldTypeRequiredDescription
namespaces[]stringNoNamespaces that cannot be targeted
labelsmap[string]stringNoResources with these labels cannot be targeted
names[]ProtectedResourceNoSpecific named resources

ProtectedResource

FieldTypeRequiredDescription
kindstringYesResource kind (e.g. Pod, Node)
namestringYesResource name
namespacestringNoNamespace (for namespaced resources)

spec.actionLimits

Restricts which action types are allowed and caps experiment duration.

FieldTypeRequiredDescription
allowedActions[]stringNoAllowed action types (empty = all allowed)
maxDurationDurationNoMaximum experiment duration

spec.timeWindows

Controls when experiments can run using cron expressions.

FieldTypeDescription
allowed[]TimeWindowExperiments can only run during these windows
blocked[]TimeWindowExperiments are blocked during these windows

Blocked windows take precedence over allowed windows.

TimeWindow

FieldTypeRequiredDescription
namestringYesWindow name
schedulestringYes5-field cron expression (e.g. "0 9 * * 1-5")
durationstringYesWindow duration (e.g. 8h, 30m)
timezonestringYesIANA timezone (e.g. UTC, America/New_York)

Cron format: minute hour day-of-month month day-of-week

The 7-step evaluation chain

When an experiment is created or updated, the webhook evaluates it against all applicable policies in order:

  1. Namespace scope - Is the target namespace in spec.scope.namespaces?
  2. Label scope - Does the target match spec.scope.labelSelector?
  3. Action type - Is the action in spec.actionLimits.allowedActions?
  4. Max targets - Would the experiment exceed spec.targetLimits.maxTargets?
  5. Max percentage - Would the experiment exceed spec.targetLimits.maxPercentage?
  6. Time windows - Is the current time in an allowed window and not in a blocked window?
  7. Enforcement - If Audit, log and allow. If Enforce, reject.

Multiple policies

Multiple policies can apply to the same experiment. All policies are evaluated, and the experiment is blocked if any one rejects it.

Printer columns

NAME ENFORCEMENT MAX TARGETS AGE
production-guardrails Enforce 2 1d