action Pod

Delete Some Pods

Delete a single a pod gracefully, to simulate a failing condition

Run it now
View details
Typeaction
Modulechaosk8s.pod.actions
Nameterminate_pods
ReturnNone

Usage

JSON

{
  "name": "delete-pod",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosk8s.pod.actions",
    "func": "terminate_pods"
  }
}

YAML

name: delete-pod
provider:
  func: terminate_pods
  module: chaosk8s.pod.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
nsstring”default”YesNamespace
label_selectorstringnullYesLabel SelectorSelectors to target the appropriate pod

Select the appropriate pods by label and/or name patterns. Whenever a pattern is provided for the name, all pods retrieved will be filtered out if their name does not match the given pattern.

If neither label_selector nor name_pattern is provided, all pods in the namespace will be selected for termination.

Signature

def terminate_pods(label_selector: str = None,
                   name_pattern: str = None,
                   all: bool = False,
                   rand: bool = False,
                   mode: str = 'fixed',
                   qty: int = 1,
                   grace_period: int = -1,
                   ns: str = 'default',
                   order: str = 'alphabetic',
                   secrets: Dict[str, Dict[str, str]] = None):
    pass