probe Pod

count_pods

Count the number of pods matching the given selector

Activity as code

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

Typeprobe
Modulechaosk8s.pod.probes
Namecount_pods
Returninteger

Usage

JSON

{
  "name": "count-pods",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosk8s.pod.probes",
    "func": "count_pods",
    "arguments": {
      "label_selector": ""
    }
  }
}

YAML

name: count-pods
provider:
  arguments:
    label_selector: ''
  func: count_pods
  module: chaosk8s.pod.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequired
label_selectorstringYes
phasestringnullNo
nsstring“default”No

Signature

def count_pods(label_selector: str,
               phase: str = None,
               ns: str = 'default',
               secrets: Dict[str, Dict[str, str]] = None) -> int:
    pass