actionNode

delete_nodes

Delete nodes gracefully

Activity as code

Below are the details and signature of the activity Python module.

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_selectorstringnullYesLabel SelectorSelectors to target the appropriate nodes
allbooleanfalseNoAll NodesDelete all nodes matching the selector
randbooleanfalseNoRandom SelectionDelete only a random selection matching the selector
countintegernullNoDeletion AmountAmount of nodes to delete
grace_period_secondsintegernullNoGrace PeriodGrace period for node termination
pod_label_selectorstringnullNoPer Pod SelectionSelect nodes running the matching pods selection
pod_namespacestringnullNoPod 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.

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