Skip to main content

Docker service kill


Docker service kill makes the application unreachable on the account of the node turning unschedulable (in NotReady status).

  • Docker service is stopped (or killed) on a node to make it unschedulable for a specific duration.
  • The application node goes back to normal state and services are resumed after a specific duration.

Docker Service Kill

Use cases

Docker service kill fault determines the resilience of an application when a node becomes unschedulable, that is, NotReady state.

  • Kubernetes > 1.16 is required to execute this fault.
  • Node specified in the TARGET_NODE environment variable (the node for which Docker service would be killed) should be cordoned before executing the chaos fault. This ensures that the fault resources are not scheduled on it or subject to eviction. This is achieved using the following steps:
    • Get node names against the applications pods using command kubectl get pods -o wide.
    • Cordon the node using command kubectl cordon <nodename>.
  • The target nodes should be in the ready state before and after injecting chaos.

Fault tunables

Mandatory tunables

Tunable Description Notes
TARGET_NODE Name of the target node. For example, node-1. For For more information, go to target node.
NODE_LABEL Node label used to filter the target node if TARGET_NODE environment variable is not set. It is mutually exclusive with the TARGET_NODE environment variable. If both are provided, the fault uses TARGET_NODE. For more information, go to node label.

Optional tunables

Tunable Description Notes
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Default: 60 s. For more information, go to duration of the chaos.
RAMP_TIME Period to wait before injecting chaos (in seconds). For example, 30 s. For more information, go to ramp time.

Kill docker service

Name of the target node. Tune it by using the TARGET_NODE environment variable.

The following YAML snippet illustrates the use of this environment variable:

# kill the docker service of the target node
kind: ChaosEngine
name: engine-nginx
engineState: "active"
annotationCheck: "false"
chaosServiceAccount: litmus-admin
- name: docker-service-kill
# name of the target node
value: 'node01'
VALUE: '60'