From c033aa434edd4f01344081d5a16a11cf0b45e5cd Mon Sep 17 00:00:00 2001 From: Yashashree Suresh Date: Wed, 22 Apr 2020 11:12:21 +0530 Subject: [PATCH] Added support to kill prometheus pods --- README.md | 2 ++ scenarios/post_action_prometheus.yml | 22 ++++++++++++++++++++++ scenarios/prometheus.yml | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 scenarios/post_action_prometheus.yml create mode 100644 scenarios/prometheus.yml diff --git a/README.md b/README.md index 663ba0c3..766d4acc 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,5 @@ Component | Description ------------------------ | ---------------------------------------------------------------------------------------------------| ------------------------- | Etcd | Kills a single/multiple etcd replicas for the specified number of times in a loop | :heavy_check_mark: | Kube ApiServer | Kills a single/multiple kube-apiserver replicas for the specified number of times in a loop | :heavy_check_mark: | +ApiServer | Kills a single/multiple apiserver replicas for the specified number of times in a loop | :heavy_check_mark: | +Prometheus | Kills a single/multiple prometheus replicas for the specified number of times in a loop | :heavy_check_mark: | diff --git a/scenarios/post_action_prometheus.yml b/scenarios/post_action_prometheus.yml new file mode 100644 index 00000000..ebae7879 --- /dev/null +++ b/scenarios/post_action_prometheus.yml @@ -0,0 +1,22 @@ +config: + runStrategy: + runs: 1 + maxSecondsBetweenRuns: 10 + minSecondsBetweenRuns: 1 +scenarios: + - name: "check 2 pods are in namespace with selector: prometheus" + steps: + - podAction: + matches: + - labels: + namespace: "openshift-monitoring" + selector: "app=prometheus" + filters: + - property: + name: "state" + value: "Running" + # The actions will be executed in the order specified + actions: + - checkPodCount: + count: 2 + \ No newline at end of file diff --git a/scenarios/prometheus.yml b/scenarios/prometheus.yml new file mode 100644 index 00000000..086764fc --- /dev/null +++ b/scenarios/prometheus.yml @@ -0,0 +1,23 @@ +config: + runStrategy: + runs: 1 + maxSecondsBetweenRuns: 30 + minSecondsBetweenRuns: 1 +scenarios: + - name: "delete prometheus pods" + steps: + - podAction: + matches: + - labels: + namespace: "openshift-monitoring" + selector: "app=prometheus" + + filters: + - randomSample: + size: 1 + + # The actions will be executed in the order specified + actions: + - kill: + probability: 1 + force: true