Skip to main content

node-taint

Adds a taint to target nodes. Pods without a matching toleration will be evicted (NoExecute) or not scheduled (NoSchedule).

Target kind: Node
Implementation: Kubernetes API (no daemon)
Rollback: Yes — removes the taint from the node

Parameters

NameTypeRequiredDefaultDescription
keystringYesTaint key
valuestringNo""Taint value
effectstringYesNoSchedule, NoExecute, or PreferNoSchedule

Example

apiVersion: chaos.chaosplane.io/v1alpha1
kind: ChaosExperiment
metadata:
name: node-taint-example
namespace: chaosplane
spec:
target:
kind: Node
names:
- worker-node-1
action:
type: node-taint
parameters:
key: "chaos.chaosplane.io/test"
value: "true"
effect: "NoSchedule"
duration: 2m
rollback:
enabled: true

Rollback behavior

Removes the taint by filtering it out of node.Spec.Taints and updating the node via the Kubernetes API. Only the taint with the matching key and effect is removed.

Implementation notes

Uses the Kubernetes API directly. The operation is idempotent: if a taint with the same key and effect already exists, it's skipped. Valid effects are NoSchedule, NoExecute, and PreferNoSchedule. Both key and effect are required and validated before execution.