Skip to main content

stress-cpu

Generic CPU stress action. Runs CPU stress workers via the daemon without pod-level cgroup scoping. Targets nodes directly.

Target kind: Node
Implementation: Daemon (ExecStressChaos with stressorType: cpu)
Rollback: Yes — sends CancelChaos to terminate stress-ng

Parameters

NameTypeRequiredDefaultDescription
workersstringNo"1"Number of CPU stress worker threads
loadstringNo"100"Target CPU load percentage (0-100)
durationstringNoexperiment durationHow long to run stress

Example

apiVersion: chaos.chaosplane.io/v1alpha1
kind: ChaosExperiment
metadata:
name: stress-cpu-example
namespace: chaosplane
spec:
target:
kind: Node
labelSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
action:
type: stress-cpu
parameters:
workers: "2"
load: "75"
duration: "60s"
duration: 60s
rollback:
enabled: true

Rollback behavior

Sends CancelChaos RPC to the daemon, which terminates the stress-ng process.

Implementation notes

This is the generic stress-cpu action registered in the executor registry. It behaves identically to node-cpu-stress but is registered under the stress-cpu action type name. Use pod-cpu-stress if you want CPU stress scoped to a specific pod's cgroup.