Skip to main content

Node taint

Node taint taints the node by applying the desired effect.

  • The resources that contain the corresponding tolerations only can bypass the taints.

Node Taint

Usage

View the uses of the fault
The fault aims to verify the resiliency of applications when a certain taint is added to a node. It simulates loss of critical services (or node-crash). It verifies resource budgeting on cluster nodes (whether request(or limit) settings honored on available nodes), and whether topology constraints are adhered to (node selectors, tolerations, zone distribution, affinity(or anti-affinity) policies) or not.

Prerequisites

  • Kubernetes > 1.16
  • 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 by 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>.

Default validations

The target nodes should be in the ready state before and after injecting chaos.

Fault tunables

Fault tunables

Mandatory fields

Variables Description Notes
TARGET_NODE Name of the node to be tainted.
NODE_LABEL It contains node label, which will be used to filter the target nodes if TARGET_NODES ENV is not set It is mutually exclusive with the TARGET_NODES ENV. If both are provided then it will use the TARGET_NODES.
TAINT_LABEL Label and the effect to be tainted on the application node.

Optional fields

Variables Description Notes
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Defaults to 60s.
RAMP_TIME Period to wait before and after injecting chaos (in seconds). For example, 30s.

Fault examples

Common and node-specific tunables

Refer to the common attributes and node-specific tunables to tune the common tunables for all faults and node specific tunables.

Taint label

It contains the label and the effect to be tainted on the application node. You can tune it using the TAINT_LABEL environment variable.

Use the following example to tune it:

# node tainted with provided key and effect
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
chaosServiceAccount: litmus-admin
experiments:
- name: node-taint
spec:
components:
env:
# label and effect to be tainted on the targeted node
- name: TAINT_LABEL
value: 'key=value:effect'
- name: TOTAL_CHAOS_DURATION
VALUE: '60'