Kubernetes
action Node

# delete_nodes

Delete nodes gracefully

Run it now
View details

Type | action
Module | chaosk8s.node.actions
Name | delete_nodes
Return | None

Usage

JSON

    {
      "name": "delete-nodes",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "chaosk8s.node.actions",
        "func": "delete_nodes"
      }
    }

YAML

    name: delete-nodes
    provider:
      func: delete_nodes
      module: chaosk8s.node.actions
      type: python
    type: action

Arguments

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
label_selector | string |  | Yes | Label Selector | Selectors to target the appropriate nodes
all | boolean | false | No | All Nodes | Delete all nodes matching the selector
rand | boolean | false | No | Random Selection | Delete only a random selection matching the selector
count | integer | 1 | No | Deletion Amount | Amount of nodes to delete
grace_period_seconds | integer |  | No | Grace Period | Grace period for node termination
pod_label_selector | string |  | No | Per Pod Selection | Select nodes running the matching pods selection
pod_namespace | string |  | No | Pod Namespace | Pods selection namespace

Select the appropriate nodes by label.

Nodes are not drained beforehand so we can see how the cluster behaves. Nodes cannot be restarted, they are deleted. Please be careful when using this action.

On certain cloud providers, you also need to delete the underneath VM instance as well afterward. This is the case with GCE for instance.

- If `all` is set to `True`, all nodes will be terminated.
- If `rand` is set to `True`, one random node will be terminated.
- If ̀`count` is set to a positive number, only a upto `count` nodes (randomly picked) will be terminated. Otherwise, the first retrieved node will be terminated.

Signature

    def delete_nodes(label_selector: str = None,
                     all: bool = False,
                     rand: bool = False,
                     count: int = None,
                     grace_period_seconds: int = None,
                     secrets: Dict[str, Dict[str, str]] = None,
                     pod_label_selector: str = None,
                     pod_namespace: str = None):
        pass

## Related starters

- Kubernetes
  action Node

  ## `uncordon_node`

  Uncordon nodes matching the given label name, so that pods can be scheduled on them again
- Kubernetes
  probe Node

  ## `all_nodes_must_be_ready_to_schedule`

  Verifies that all nodes in the cluster are in Ready condition and can be scheduled.
- Kubernetes
  action Node

  ## `uncordon_node`

  Uncordon nodes matching the given label name, so that pods can be scheduled on them again