From 98995c4254bb42ba2ff5ced8dd1e33cce4e97a72 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Wed, 25 Mar 2020 16:38:02 +0530 Subject: [PATCH] feat(chaos_ns): Adding chaos namespace in all experiments (#1340) Signed-off-by: shubhamchaudhary --- .../containerd_chaos/crictl-chaos.yml | 2 +- chaoslib/litmus/cordon_drain_node.yml | 2 +- chaoslib/litmus/cpu_hog/pod_cpu_hog.yml | 2 +- .../litmus/disk_fill/disk_fill_by_litmus.yml | 2 +- chaoslib/litmus/kill_random_pod.yml | 2 +- chaoslib/litmus/platform/aws/disk_loss.yml | 2 +- chaoslib/litmus/platform/gke/disk_loss.yml | 2 +- .../litmus/platform/gke/node_cpu_consumption.yml | 2 +- .../platform/gke/node_memory_consumption.yml | 2 +- .../powerfulseal/pod_failure_by_powerfulseal.yml | 2 +- chaoslib/pumba/network_chaos/network_chaos.yml | 2 +- chaoslib/pumba/pod_failure_by_sigkill.yml | 2 +- .../pod_delete/pod_delete_ansible_logic.yml | 9 ++++++--- .../coredns/pod_delete/pod_delete_k8s_job.yml | 6 ------ .../container_kill_ansible_logic.yml | 12 ++++++++---- .../disk_fill/disk_fill_ansible_logic.yml | 12 ++++++++---- .../disk_loss/disk_loss_ansible_logic.yml | 9 ++++++--- .../generic/disk_loss/disk_loss_k8s_job.yml | 6 ------ .../node_cpu_hog/node_cpu_hog_ansible_logic.yml | 12 ++++++++---- .../node_drain/node_drain_ansible_logic.yml | 12 ++++++++---- .../node_memory_hog_ansible_logic.yml | 12 ++++++++---- .../pod_cpu_hog/pod_cpu_hog_ansible_logic.yml | 12 ++++++++---- .../pod_delete/pod_delete_ansible_logic.yml | 12 ++++++++---- .../pod_network_corruption_ansible_logic.yml | 12 ++++++++---- .../pod_network_latency_ansible_logic.yml | 12 ++++++++---- .../pod_network_loss_ansible_logic.yml | 12 ++++++++---- .../kafka-broker-disk-failure-ansible-logic.yml | 13 ++++++++----- ...afka-broker-network-latency-ansible-logic.yml | 13 ++++++++----- .../kafka-broker-network-loss-ansible-logic.yml | 13 ++++++++----- .../kafka-broker-pod-failure-ansible-logic.yml | 15 +++++++++------ ...openebs_control_plane_chaos_ansible_logic.yml | 16 ++++++++-------- ...penebs_control_plane_chaos_internal_tasks.yml | 1 - ...nebs_pool_container_failure_ansible_logic.yml | 12 ++++++++---- .../openebs_pool_disk_loss_ansible_logic.yml | 15 +++++++++------ .../openebs_pool_disk_loss_k8s_job.yml | 6 ------ .../openebs_pool_network_delay_ansible_logic.yml | 12 ++++++++---- .../openebs_pool_network_loss_ansible_logic.yml | 12 ++++++++---- .../openebs_pool_pod_failure_ansible_logic.yml | 12 ++++++++---- ...bs_target_container_failure_ansible_logic.yml | 12 ++++++++---- ...penebs_target_network_delay_ansible_logic.yml | 12 ++++++++---- ...openebs_target_network_loss_ansible_logic.yml | 12 ++++++++---- .../openebs_target_pod_failure_ansible_logic.yml | 12 ++++++++---- utils/runtime/getting_failure_step.yml | 6 +++--- 43 files changed, 221 insertions(+), 147 deletions(-) diff --git a/chaoslib/litmus/container_kill/containerd_chaos/crictl-chaos.yml b/chaoslib/litmus/container_kill/containerd_chaos/crictl-chaos.yml index 72cfb3624..5ef4518c8 100644 --- a/chaoslib/litmus/container_kill/containerd_chaos/crictl-chaos.yml +++ b/chaoslib/litmus/container_kill/containerd_chaos/crictl-chaos.yml @@ -121,7 +121,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ app_container }} container of {{ app_pod }} pod" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/cordon_drain_node.yml b/chaoslib/litmus/cordon_drain_node.yml index 620b910ba..c3a386de1 100644 --- a/chaoslib/litmus/cordon_drain_node.yml +++ b/chaoslib/litmus/cordon_drain_node.yml @@ -9,7 +9,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ app_node }} node" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/cpu_hog/pod_cpu_hog.yml b/chaoslib/litmus/cpu_hog/pod_cpu_hog.yml index 2c3418b1d..8b9e48464 100644 --- a/chaoslib/litmus/cpu_hog/pod_cpu_hog.yml +++ b/chaoslib/litmus/cpu_hog/pod_cpu_hog.yml @@ -93,7 +93,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ app_pod }} pod" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/disk_fill/disk_fill_by_litmus.yml b/chaoslib/litmus/disk_fill/disk_fill_by_litmus.yml index ba319a487..221309f4b 100644 --- a/chaoslib/litmus/disk_fill/disk_fill_by_litmus.yml +++ b/chaoslib/litmus/disk_fill/disk_fill_by_litmus.yml @@ -90,7 +90,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ pod_name.stdout }}" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/kill_random_pod.yml b/chaoslib/litmus/kill_random_pod.yml index a3b1d5804..84e07de6a 100644 --- a/chaoslib/litmus/kill_random_pod.yml +++ b/chaoslib/litmus/kill_random_pod.yml @@ -58,7 +58,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ app_pod }} pod" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/platform/aws/disk_loss.yml b/chaoslib/litmus/platform/aws/disk_loss.yml index 58dc149ae..effc0980a 100644 --- a/chaoslib/litmus/platform/aws/disk_loss.yml +++ b/chaoslib/litmus/platform/aws/disk_loss.yml @@ -7,7 +7,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ disk_name }} disk" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/platform/gke/disk_loss.yml b/chaoslib/litmus/platform/gke/disk_loss.yml index 0c8abf3c7..6b5f7eaa3 100644 --- a/chaoslib/litmus/platform/gke/disk_loss.yml +++ b/chaoslib/litmus/platform/gke/disk_loss.yml @@ -7,7 +7,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ disk_name }} disk" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/platform/gke/node_cpu_consumption.yml b/chaoslib/litmus/platform/gke/node_cpu_consumption.yml index e5ef98a88..dafd785b9 100644 --- a/chaoslib/litmus/platform/gke/node_cpu_consumption.yml +++ b/chaoslib/litmus/platform/gke/node_cpu_consumption.yml @@ -39,7 +39,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ node_name }} node" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/litmus/platform/gke/node_memory_consumption.yml b/chaoslib/litmus/platform/gke/node_memory_consumption.yml index 054c3d691..af05672da 100644 --- a/chaoslib/litmus/platform/gke/node_memory_consumption.yml +++ b/chaoslib/litmus/platform/gke/node_memory_consumption.yml @@ -27,7 +27,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ node_name }} node" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/powerfulseal/pod_failure_by_powerfulseal.yml b/chaoslib/powerfulseal/pod_failure_by_powerfulseal.yml index 5b3c95ea3..75b0a5648 100644 --- a/chaoslib/powerfulseal/pod_failure_by_powerfulseal.yml +++ b/chaoslib/powerfulseal/pod_failure_by_powerfulseal.yml @@ -9,7 +9,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on application pod" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/pumba/network_chaos/network_chaos.yml b/chaoslib/pumba/network_chaos/network_chaos.yml index e3eae03ed..7e687447c 100644 --- a/chaoslib/pumba/network_chaos/network_chaos.yml +++ b/chaoslib/pumba/network_chaos/network_chaos.yml @@ -83,7 +83,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ app_pod }} pod" when: "c_engine is defined and c_engine != ''" diff --git a/chaoslib/pumba/pod_failure_by_sigkill.yml b/chaoslib/pumba/pod_failure_by_sigkill.yml index e95701c1f..124fafdca 100644 --- a/chaoslib/pumba/pod_failure_by_sigkill.yml +++ b/chaoslib/pumba/pod_failure_by_sigkill.yml @@ -81,7 +81,7 @@ vars: stage: "ChaosInject" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Injecting {{ c_experiment }} chaos on {{ a_container }} container of {{ app_pod }} pod" when: "c_engine is defined and c_engine != ''" diff --git a/experiments/coredns/pod_delete/pod_delete_ansible_logic.yml b/experiments/coredns/pod_delete/pod_delete_ansible_logic.yml index 9aade5942..40098d442 100644 --- a/experiments/coredns/pod_delete/pod_delete_ansible_logic.yml +++ b/experiments/coredns/pod_delete/pod_delete_ansible_logic.yml @@ -8,7 +8,6 @@ c_interval: "{{ lookup('env','CHAOS_INTERVAL') }}" c_force: "{{ lookup('env','FORCE') }}" c_lib: "{{ lookup('env','LIB') }}" - c_ns: "{{ lookup('env','CHAOS_NAMESPACE') }}" a_ns: "{{ lookup('env','APP_NAMESPACE') }}" a_label: "{{ lookup('env','APP_LABEL') }}" a_kind: "{{ lookup('env','APP_KIND') }}" @@ -25,6 +24,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -79,7 +82,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -112,7 +115,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" diff --git a/experiments/coredns/pod_delete/pod_delete_k8s_job.yml b/experiments/coredns/pod_delete/pod_delete_k8s_job.yml index bab18ae48..aa8951dee 100644 --- a/experiments/coredns/pod_delete/pod_delete_k8s_job.yml +++ b/experiments/coredns/pod_delete/pod_delete_k8s_job.yml @@ -34,12 +34,6 @@ spec: - name: APP_KIND value: 'deployment' - # This is a chaos namespace which will create all infra chaos resources in that namespace - - name: CHAOS_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: TOTAL_CHAOS_DURATION value: '15' diff --git a/experiments/generic/container_kill/container_kill_ansible_logic.yml b/experiments/generic/container_kill/container_kill_ansible_logic.yml index 42a66a248..10cd6c306 100644 --- a/experiments/generic/container_kill/container_kill_ansible_logic.yml +++ b/experiments/generic/container_kill/container_kill_ansible_logic.yml @@ -23,6 +23,10 @@ - include_vars: file: chaosutil.yml + + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" ## GENERATE EXP RESULT NAME - name: Construct chaos result name @@ -34,7 +38,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK @@ -51,7 +55,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -78,7 +82,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -98,4 +102,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/disk_fill/disk_fill_ansible_logic.yml b/experiments/generic/disk_fill/disk_fill_ansible_logic.yml index 516505edb..0653b21d6 100644 --- a/experiments/generic/disk_fill/disk_fill_ansible_logic.yml +++ b/experiments/generic/disk_fill/disk_fill_ansible_logic.yml @@ -20,6 +20,10 @@ tasks: - block: + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -30,7 +34,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK @@ -65,7 +69,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -104,7 +108,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -124,4 +128,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/disk_loss/disk_loss_ansible_logic.yml b/experiments/generic/disk_loss/disk_loss_ansible_logic.yml index 902463add..671be2941 100644 --- a/experiments/generic/disk_loss/disk_loss_ansible_logic.yml +++ b/experiments/generic/disk_loss/disk_loss_ansible_logic.yml @@ -9,7 +9,6 @@ ramp_time: "{{ lookup('env','RAMP_TIME') }}" c_experiment: disk-loss cloud_platform: "{{ lookup('env','CLOUD_PLATFORM') }}" - c_ns: "{{ lookup('env','CHAOS_NAMESPACE') }}" disk_name: "{{ lookup('env','DISK_NAME') }}" device_name: "{{ lookup('env', 'DEVICE_NAME') }}" node_name: "{{ lookup('env','NODE_NAME') }}" @@ -28,6 +27,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -73,7 +76,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -138,7 +141,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Disk has been reattached and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" diff --git a/experiments/generic/disk_loss/disk_loss_k8s_job.yml b/experiments/generic/disk_loss/disk_loss_k8s_job.yml index cc3e1a8b3..7aa4f5af8 100644 --- a/experiments/generic/disk_loss/disk_loss_k8s_job.yml +++ b/experiments/generic/disk_loss/disk_loss_k8s_job.yml @@ -32,12 +32,6 @@ spec: - name: APP_NAMESPACE value: '' - # This is a chaos namespace which will create all infra chaos resources in that namespace - - name: CHAOS_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - # GKE and AWS supported - name: CLOUD_PLATFORM value: 'GKE' diff --git a/experiments/generic/node_cpu_hog/node_cpu_hog_ansible_logic.yml b/experiments/generic/node_cpu_hog/node_cpu_hog_ansible_logic.yml index 2b2455ef8..cdc26bb96 100644 --- a/experiments/generic/node_cpu_hog/node_cpu_hog_ansible_logic.yml +++ b/experiments/generic/node_cpu_hog/node_cpu_hog_ansible_logic.yml @@ -24,6 +24,10 @@ - include_vars: file: chaosutil.yml + + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" ## GENERATE EXP RESULT NAME - name: Construct chaos result name @@ -36,7 +40,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK - name: Verify that the AUT (Application Under Test) is running @@ -70,7 +74,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -139,7 +143,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -160,4 +164,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/node_drain/node_drain_ansible_logic.yml b/experiments/generic/node_drain/node_drain_ansible_logic.yml index 5bcac1fc7..058ef6707 100644 --- a/experiments/generic/node_drain/node_drain_ansible_logic.yml +++ b/experiments/generic/node_drain/node_drain_ansible_logic.yml @@ -29,6 +29,10 @@ - include_tasks: /utils/common/application_liveness_check.yml when: liveness_label != '' + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -40,7 +44,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -83,7 +87,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -123,7 +127,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Node has been uncordoned and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -146,4 +150,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/node_memory_hog/node_memory_hog_ansible_logic.yml b/experiments/generic/node_memory_hog/node_memory_hog_ansible_logic.yml index 3d3d9026d..8689597bd 100644 --- a/experiments/generic/node_memory_hog/node_memory_hog_ansible_logic.yml +++ b/experiments/generic/node_memory_hog/node_memory_hog_ansible_logic.yml @@ -24,6 +24,10 @@ - include_vars: file: chaosutil.yml + + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" ## GENERATE EXP RESULT NAME - name: Construct chaos result name (experiment_name) @@ -35,7 +39,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK - name: Verify that the AUT (Application Under Test) is running @@ -69,7 +73,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -137,7 +141,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -158,4 +162,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/pod_cpu_hog/pod_cpu_hog_ansible_logic.yml b/experiments/generic/pod_cpu_hog/pod_cpu_hog_ansible_logic.yml index c77b28d7c..84096b155 100644 --- a/experiments/generic/pod_cpu_hog/pod_cpu_hog_ansible_logic.yml +++ b/experiments/generic/pod_cpu_hog/pod_cpu_hog_ansible_logic.yml @@ -26,6 +26,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -36,7 +40,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK - name: Verify that the AUT (Application Under Test) is running @@ -52,7 +56,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -76,7 +80,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -98,4 +102,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/pod_delete/pod_delete_ansible_logic.yml b/experiments/generic/pod_delete/pod_delete_ansible_logic.yml index 11abe87f8..9735797fc 100644 --- a/experiments/generic/pod_delete/pod_delete_ansible_logic.yml +++ b/experiments/generic/pod_delete/pod_delete_ansible_logic.yml @@ -26,6 +26,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -36,7 +40,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK @@ -53,7 +57,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -79,7 +83,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -99,4 +103,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/pod_network_corruption/pod_network_corruption_ansible_logic.yml b/experiments/generic/pod_network_corruption/pod_network_corruption_ansible_logic.yml index c50ec39e6..42927ef15 100644 --- a/experiments/generic/pod_network_corruption/pod_network_corruption_ansible_logic.yml +++ b/experiments/generic/pod_network_corruption/pod_network_corruption_ansible_logic.yml @@ -27,6 +27,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -37,7 +41,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK - name: Verify that the AUT (Application Under Test) is running @@ -53,7 +57,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -76,7 +80,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -98,4 +102,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/pod_network_latency/pod_network_latency_ansible_logic.yml b/experiments/generic/pod_network_latency/pod_network_latency_ansible_logic.yml index 5f7ecd5bc..bdc33b761 100644 --- a/experiments/generic/pod_network_latency/pod_network_latency_ansible_logic.yml +++ b/experiments/generic/pod_network_latency/pod_network_latency_ansible_logic.yml @@ -27,6 +27,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -37,7 +41,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK - name: Verify that the AUT (Application Under Test) is running @@ -53,7 +57,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -76,7 +80,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -98,4 +102,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/generic/pod_network_loss/pod_network_loss_ansible_logic.yml b/experiments/generic/pod_network_loss/pod_network_loss_ansible_logic.yml index 1fdb550b4..e893c4dd3 100644 --- a/experiments/generic/pod_network_loss/pod_network_loss_ansible_logic.yml +++ b/experiments/generic/pod_network_loss/pod_network_loss_ansible_logic.yml @@ -27,6 +27,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -37,7 +41,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK - name: Verify that the AUT (Application Under Test) is running @@ -53,7 +57,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -76,7 +80,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -96,4 +100,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/kafka/kafka-broker-disk-failure/kafka-broker-disk-failure-ansible-logic.yml b/experiments/kafka/kafka-broker-disk-failure/kafka-broker-disk-failure-ansible-logic.yml index 871ffa677..8e82d5ca4 100644 --- a/experiments/kafka/kafka-broker-disk-failure/kafka-broker-disk-failure-ansible-logic.yml +++ b/experiments/kafka/kafka-broker-disk-failure/kafka-broker-disk-failure-ansible-logic.yml @@ -27,7 +27,6 @@ c_engine: "{{ lookup('env','CHAOSENGINE') }}" chaos_pod_name: "{{ lookup('env','POD_NAME') }}" chaos_uid: "{{ lookup('env','CHAOS_UID') }}" - a_ns: "{{ lookup('env','KAFKA_NAMESPACE') }}" tasks: - block: @@ -37,6 +36,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ kafka_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -47,7 +50,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ kafka_ns }}" + namespace: "{{ c_ns }}" - name: Verify mandatory Kafka broker and disk information debug: @@ -73,7 +76,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -136,7 +139,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Disk has been reattached and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -178,4 +181,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ kafka_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/kafka/kafka-broker-network-latency/kafka-broker-network-latency-ansible-logic.yml b/experiments/kafka/kafka-broker-network-latency/kafka-broker-network-latency-ansible-logic.yml index b39f1721e..f0f6eb89c 100644 --- a/experiments/kafka/kafka-broker-network-latency/kafka-broker-network-latency-ansible-logic.yml +++ b/experiments/kafka/kafka-broker-network-latency/kafka-broker-network-latency-ansible-logic.yml @@ -28,7 +28,6 @@ chaos_uid: "{{ lookup('env','CHAOS_UID') }}" c_engine: "{{ lookup('env','CHAOSENGINE') }}" chaos_pod_name: "{{ lookup('env','POD_NAME') }}" - a_ns: "{{ lookup('env','KAFKA_NAMESPACE') }}" tasks: - block: @@ -38,6 +37,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ kafka_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -48,7 +51,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ kafka_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK @@ -63,7 +66,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -96,7 +99,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -137,4 +140,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ kafka_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/kafka/kafka-broker-network-loss/kafka-broker-network-loss-ansible-logic.yml b/experiments/kafka/kafka-broker-network-loss/kafka-broker-network-loss-ansible-logic.yml index a0ac13f78..699275f1e 100644 --- a/experiments/kafka/kafka-broker-network-loss/kafka-broker-network-loss-ansible-logic.yml +++ b/experiments/kafka/kafka-broker-network-loss/kafka-broker-network-loss-ansible-logic.yml @@ -28,7 +28,6 @@ chaos_uid: "{{ lookup('env','CHAOS_UID') }}" c_engine: "{{ lookup('env','CHAOSENGINE') }}" chaos_pod_name: "{{ lookup('env','POD_NAME') }}" - a_ns: "{{ lookup('env','KAFKA_NAMESPACE') }}" tasks: - block: @@ -38,6 +37,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ kafka_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -48,7 +51,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ kafka_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK @@ -63,7 +66,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -95,7 +98,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -136,4 +139,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ kafka_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/kafka/kafka-broker-pod-failure/kafka-broker-pod-failure-ansible-logic.yml b/experiments/kafka/kafka-broker-pod-failure/kafka-broker-pod-failure-ansible-logic.yml index 20028f067..624e2f210 100644 --- a/experiments/kafka/kafka-broker-pod-failure/kafka-broker-pod-failure-ansible-logic.yml +++ b/experiments/kafka/kafka-broker-pod-failure/kafka-broker-pod-failure-ansible-logic.yml @@ -29,8 +29,7 @@ chaos_uid: "{{ lookup('env','CHAOS_UID') }}" c_engine: "{{ lookup('env','CHAOSENGINE') }}" chaos_pod_name: "{{ lookup('env','POD_NAME') }}" - a_ns: "{{ lookup('env','KAFKA_NAMESPACE') }}" - + tasks: - block: @@ -39,6 +38,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ kafka_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -49,7 +52,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ kafka_ns }}" + namespace: "{{ c_ns }}" ## PRE-CHAOS APPLICATION LIVENESS CHECK @@ -64,7 +67,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -94,7 +97,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -135,4 +138,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ kafka_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_ansible_logic.yml b/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_ansible_logic.yml index b8cd2aba6..99c33a1fc 100644 --- a/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_ansible_logic.yml +++ b/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_ansible_logic.yml @@ -22,6 +22,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ openebs_ns }}" + - name: Include openebs control plane components include_vars: file: /experiments/openebs/openebs_control_plane_components.yml @@ -37,22 +41,20 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ openebs_ns }}" + namespace: "{{ c_ns }}" ## RECORD EVENT FOR PRE-CHAOS CHECK - include_tasks: /utils/common/generate-kubernetes-chaos-events.yml vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ openebs_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS control plane components are Running successfully" when: "c_engine is defined and c_engine != ''" ## INJECT CHAOS ON CONTROL PLANE COMPONENTS - name: Including main components include_tasks: openebs_control_plane_chaos_internal_tasks.yml - vars: - app_ns: "{{ openebs_ns }}" loop: "{{ openebs.components }}" ## RECORD EVENT FOR POST-CHAOS CHECK @@ -60,7 +62,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ openebs_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS control plane components are Running successfully" when: "c_engine is defined and c_engine != ''" @@ -75,11 +77,9 @@ ## Getting failure step from experiment-pod - include_tasks: /utils/runtime/getting_failure_step.yml - vars: - a_ns: "{{ openebs_ns }}" ## RECORD END-OF-TEST IN LITMUSCHAOS RESULT CR - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ openebs_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_internal_tasks.yml b/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_internal_tasks.yml index 936ca29bb..337c8c6ca 100644 --- a/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_internal_tasks.yml +++ b/experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_internal_tasks.yml @@ -12,7 +12,6 @@ vars: app_ns: "{{ item.namespace }}" app_label: "{{ item.labels[0] }}" - a_ns: "{{ app_ns }}" c_interval: 5 ## POST-CHAOS APPLICATION LIVENESS CHECK diff --git a/experiments/openebs/openebs-pool-container-failure/openebs_pool_container_failure_ansible_logic.yml b/experiments/openebs/openebs-pool-container-failure/openebs_pool_container_failure_ansible_logic.yml index a23e09e3c..7346d8b46 100644 --- a/experiments/openebs/openebs-pool-container-failure/openebs_pool_container_failure_ansible_logic.yml +++ b/experiments/openebs/openebs-pool-container-failure/openebs_pool_container_failure_ansible_logic.yml @@ -32,6 +32,10 @@ - include_tasks: /utils/common/application_liveness_check.yml when: liveness_label != '' + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + - name: Identify the data consistency util to be invoked template: src: data_persistence.j2 @@ -59,7 +63,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -94,7 +98,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT are Running successfully" when: "c_engine is defined and c_engine != ''" @@ -126,7 +130,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT are Running successfully" when: "c_engine is defined and c_engine != ''" @@ -176,4 +180,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_ansible_logic.yml b/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_ansible_logic.yml index 75aa18205..5fcbe174c 100644 --- a/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_ansible_logic.yml +++ b/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_ansible_logic.yml @@ -14,7 +14,6 @@ auxiliary_appinfo: "{{ lookup('env','AUXILIARY_APPINFO') }}" c_engine: "{{ lookup('env','CHAOSENGINE') }}" openebs_ns: "{{ lookup('env','OPENEBS_NAMESPACE') }}" - c_ns: "{{ lookup('env','CHAOS_NAMESPACE') }}" chaos_uid: "{{ lookup('env','CHAOS_UID') }}" chaos_pod_name: "{{ lookup('env','POD_NAME') }}" @@ -30,6 +29,10 @@ - include_tasks: openebs_pool_disk_loss_ansible_prerequisites.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + # GENERATE EXPERIMENT RESULT NAME - name: Construct chaos result name set_fact: @@ -39,7 +42,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" # DISPLAY APP INFORMATION - name: Display the app information passed via the test job @@ -48,7 +51,7 @@ - "The application info is as follows:" - "Namespace : {{ a_ns }}" - "Label : {{ a_label }}" - - "PVC : {{ a_pvc }}" + - "PVC : {{ a_pvc }}" # Gcloud authentication - name: Gcloud authentication @@ -91,7 +94,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -168,7 +171,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "Disk has been reattached and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -221,4 +224,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" diff --git a/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_k8s_job.yml b/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_k8s_job.yml index 07f2b3525..6ed3724ee 100644 --- a/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_k8s_job.yml +++ b/experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_k8s_job.yml @@ -29,12 +29,6 @@ spec: - name: APP_PVC value: '' - # This is a chaos namespace which will create all infra chaos resources in that namespace - - name: CHAOS_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - # GKE and AWS supported - name: CLOUD_PLATFORM value: 'GKE' diff --git a/experiments/openebs/openebs-pool-network-delay/openebs_pool_network_delay_ansible_logic.yml b/experiments/openebs/openebs-pool-network-delay/openebs_pool_network_delay_ansible_logic.yml index 80ce87fca..d594a00c6 100644 --- a/experiments/openebs/openebs-pool-network-delay/openebs_pool_network_delay_ansible_logic.yml +++ b/experiments/openebs/openebs-pool-network-delay/openebs_pool_network_delay_ansible_logic.yml @@ -29,6 +29,10 @@ - include_tasks: openebs_pool_network_delay_ansible_prerequisites.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -39,7 +43,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" # DISPLAY APP INFORMATION - name: Display the app information passed via the test job @@ -72,7 +76,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -117,7 +121,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -146,4 +150,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-pool-network-loss/openebs_pool_network_loss_ansible_logic.yml b/experiments/openebs/openebs-pool-network-loss/openebs_pool_network_loss_ansible_logic.yml index 1fc4a24db..bd9e65095 100644 --- a/experiments/openebs/openebs-pool-network-loss/openebs_pool_network_loss_ansible_logic.yml +++ b/experiments/openebs/openebs-pool-network-loss/openebs_pool_network_loss_ansible_logic.yml @@ -28,6 +28,10 @@ - include: openebs_pool_network_loss_ansible_prerequisites.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + ## GENERATE EXP RESULT NAME - name: Construct chaos result name set_fact: @@ -38,7 +42,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" # DISPLAY APP INFORMATION - name: Display the app information passed via the test job @@ -71,7 +75,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -116,7 +120,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -145,4 +149,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-pool-pod-failure/openebs_pool_pod_failure_ansible_logic.yml b/experiments/openebs/openebs-pool-pod-failure/openebs_pool_pod_failure_ansible_logic.yml index f0422eefc..d5953b012 100644 --- a/experiments/openebs/openebs-pool-pod-failure/openebs_pool_pod_failure_ansible_logic.yml +++ b/experiments/openebs/openebs-pool-pod-failure/openebs_pool_pod_failure_ansible_logic.yml @@ -48,6 +48,10 @@ when: "a_pvc is defined and a_pvc != ''" + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + - name: Identify the chaos util to be invoked template: src: chaosutil.j2 @@ -69,7 +73,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -96,7 +100,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -144,7 +148,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -198,4 +202,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-target-container-failure/openebs_target_container_failure_ansible_logic.yml b/experiments/openebs/openebs-target-container-failure/openebs_target_container_failure_ansible_logic.yml index bd11b05e0..fb1dded26 100644 --- a/experiments/openebs/openebs-target-container-failure/openebs_target_container_failure_ansible_logic.yml +++ b/experiments/openebs/openebs-target-container-failure/openebs_target_container_failure_ansible_logic.yml @@ -42,6 +42,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + - name: Record the chaos util path set_fact: chaos_util_path: "{{ chaosutil }}" @@ -63,7 +67,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -92,7 +96,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -135,7 +139,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -184,4 +188,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-target-network-delay/openebs_target_network_delay_ansible_logic.yml b/experiments/openebs/openebs-target-network-delay/openebs_target_network_delay_ansible_logic.yml index b9162fae5..00534cc42 100644 --- a/experiments/openebs/openebs-target-network-delay/openebs_target_network_delay_ansible_logic.yml +++ b/experiments/openebs/openebs-target-network-delay/openebs_target_network_delay_ansible_logic.yml @@ -40,6 +40,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + - name: Record the chaos util path set_fact: chaos_util_path: "{{ chaosutil }}" @@ -60,7 +64,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -88,7 +92,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -127,7 +131,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -159,4 +163,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-target-network-loss/openebs_target_network_loss_ansible_logic.yml b/experiments/openebs/openebs-target-network-loss/openebs_target_network_loss_ansible_logic.yml index f75dbfd79..513af0fcb 100644 --- a/experiments/openebs/openebs-target-network-loss/openebs_target_network_loss_ansible_logic.yml +++ b/experiments/openebs/openebs-target-network-loss/openebs_target_network_loss_ansible_logic.yml @@ -39,6 +39,10 @@ - include_vars: file: chaosutil.yml + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + - name: Record the chaos util path set_fact: chaos_util_path: "{{ chaosutil }}" @@ -61,7 +65,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -88,7 +92,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -127,7 +131,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -159,4 +163,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/experiments/openebs/openebs-target-pod-failure/openebs_target_pod_failure_ansible_logic.yml b/experiments/openebs/openebs-target-pod-failure/openebs_target_pod_failure_ansible_logic.yml index 4b09d1414..5ef4c65e2 100644 --- a/experiments/openebs/openebs-target-pod-failure/openebs_target_pod_failure_ansible_logic.yml +++ b/experiments/openebs/openebs-target-pod-failure/openebs_target_pod_failure_ansible_logic.yml @@ -42,6 +42,10 @@ set_fact: chaos_util_path: "{{ chaosutil }}" + - name: Getting the chaos namespace + set_fact: + c_ns: "{{ a_ns }}" + - name: Record the data consistency util path set_fact: data_consistency_util_path: "{{ consistencyutil }}" @@ -59,7 +63,7 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'SOT' - namespace: "{{ a_ns }}" + namespace: "{{ c_ns }}" ## DISPLAY APP INFORMATION @@ -88,7 +92,7 @@ vars: stage: "PreChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -131,7 +135,7 @@ vars: stage: "PostChaosCheck" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "OpenEBS components and AUT is Running successfully" when: "c_engine is defined and c_engine != ''" @@ -180,4 +184,4 @@ - include_tasks: /utils/runtime/update_chaos_result_resource.yml vars: status: 'EOT' - namespace: "{{ a_ns }}" \ No newline at end of file + namespace: "{{ c_ns }}" \ No newline at end of file diff --git a/utils/runtime/getting_failure_step.yml b/utils/runtime/getting_failure_step.yml index faa7befcd..d7e7914a0 100644 --- a/utils/runtime/getting_failure_step.yml +++ b/utils/runtime/getting_failure_step.yml @@ -13,7 +13,7 @@ ## Getting failure step from experiment-pod - name: Getting failure step from experiment pod shell: > - kubectl logs {{ chaos_pod_name }} -n {{ a_ns }} | grep "FAILED!" -B {{ offset }} | head -1 | awk -F "Step:" '{print $2}' + kubectl logs {{ chaos_pod_name }} -n {{ c_ns }} | grep "FAILED!" -B {{ offset }} | head -1 | awk -F "Step:" '{print $2}' register: fail_step args: executable: /bin/bash @@ -31,7 +31,7 @@ vars: stage: "Summary" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "{{ c_experiment }} Experiment Failed!" when: "c_engine is defined and c_engine != ''" @@ -49,7 +49,7 @@ vars: stage: "Summary" exp_pod_name: "{{ chaos_pod_name }}" - engine_ns: "{{ a_ns }}" + engine_ns: "{{ c_ns }}" message: "{{ c_experiment }} Experiment Passed!" when: "c_engine is defined and c_engine != ''"