Skip to main content

container-kill

Kills a specific container within a pod without deleting the pod. The container runtime restarts the container according to the pod's restartPolicy.

Target kind: Pod
Implementation: Daemon (ExecStressChaos with stressorType: container-kill)
Rollback: None (container runtime handles restart)

Parameters

NameTypeRequiredDefaultDescription
containerNamestringYesName of the container to kill

Example

apiVersion: chaos.chaosplane.io/v1alpha1
kind: ChaosExperiment
metadata:
name: container-kill-example
namespace: default
spec:
target:
kind: Pod
namespace: default
labelSelector:
matchLabels:
app: my-app
action:
type: container-kill
parameters:
containerName: "app"
duration: 10s
rollback:
enabled: false

Rollback behavior

No rollback. The container runtime restarts the container based on the pod's restartPolicy (Always, OnFailure, or Never).

Implementation notes

The operator resolves target pods, then for each pod contacts the daemon on the pod's node via gRPC. The daemon sends SIGKILL to the container process using the container runtime socket (containerd or CRI-O). The containerName parameter must match exactly the container name in the pod spec.

containerName is required and validated before execution.