action Node

delete_nodes

Delete nodes gracefully

Run it now
View details
Typeaction
Modulechaosk8s.node.actions
Namedelete_nodes
ReturnNone

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

NameTypeDefaultRequiredTitleDescription
label_selectorstringYesLabel SelectorSelectors to target the appropriate nodes
allbooleanfalseNoAll NodesDelete all nodes matching the selector
randbooleanfalseNoRandom SelectionDelete only a random selection matching the selector
countinteger1NoDeletion AmountAmount of nodes to delete
grace_period_secondsintegerNoGrace PeriodGrace period for node termination
pod_label_selectorstringNoPer Pod SelectionSelect nodes running the matching pods selection
pod_namespacestringNoPod NamespacePods 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