diff options
Diffstat (limited to 'roles/onap-chaos-tests/templates')
9 files changed, 390 insertions, 0 deletions
diff --git a/roles/onap-chaos-tests/templates/node-cpu-hog-chaos.yaml.j2 b/roles/onap-chaos-tests/templates/node-cpu-hog-chaos.yaml.j2 new file mode 100644 index 0000000..ce72420 --- /dev/null +++ b/roles/onap-chaos-tests/templates/node-cpu-hog-chaos.yaml.j2 @@ -0,0 +1,30 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: node-cpu-hog + namespace: {{ onap_namespace }} +spec: + # It can be true/false + annotationCheck: 'false' + # It can be active/stop + engineState: 'active' + #ex. values: ns1:name=percona,ns2:run=nginx + auxiliaryAppInfo: '' + chaosServiceAccount: node-cpu-hog-sa + # It can be delete/retain + jobCleanUpPolicy: 'delete' + experiments: + - name: node-cpu-hog + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '120' + + - name: NODE_CPU_CORE + value: '6' + + # ENTER THE COMMA SEPARATED TARGET NODES NAME + - name: TARGET_NODES + value: {{ compute_chaos }} diff --git a/roles/onap-chaos-tests/templates/node-cpu-hog-rbac.yaml.j2 b/roles/onap-chaos-tests/templates/node-cpu-hog-rbac.yaml.j2 new file mode 100644 index 0000000..e240b5e --- /dev/null +++ b/roles/onap-chaos-tests/templates/node-cpu-hog-rbac.yaml.j2 @@ -0,0 +1,49 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: node-cpu-hog-sa + namespace: {{ onap_namespace }} + labels: + name: node-cpu-hog-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: node-cpu-hog-sa + labels: + name: node-cpu-hog-sa + app.kubernetes.io/part-of: litmus +rules: +- apiGroups: [""] + resources: ["pods","events"] + verbs: ["create","list","get","patch","update","delete","deletecollection"] +- apiGroups: [""] + resources: ["pods/exec","pods/log"] + verbs: ["list","get","create"] +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] +- apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get","list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: node-cpu-hog-sa + labels: + name: node-cpu-hog-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: node-cpu-hog-sa +subjects: +- kind: ServiceAccount + name: node-cpu-hog-sa + namespace: {{ onap_namespace }}
\ No newline at end of file diff --git a/roles/onap-chaos-tests/templates/node-drain-chaos.yaml.j2 b/roles/onap-chaos-tests/templates/node-drain-chaos.yaml.j2 new file mode 100644 index 0000000..a90a5f1 --- /dev/null +++ b/roles/onap-chaos-tests/templates/node-drain-chaos.yaml.j2 @@ -0,0 +1,28 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: node-drain + namespace: {{ onap_namespace }} +spec: + # It can be true/false + annotationCheck: 'false' + # It can be active/stop + engineState: 'active' + #ex. values: ns1:name=percona,ns2:run=onap + auxiliaryAppInfo: '' + chaosServiceAccount: node-drain-sa + # It can be delete/retain + jobCleanUpPolicy: 'delete' + experiments: + - name: node-drain + spec: + components: + # nodeSelector: + # # provide the node labels + # kubernetes.io/hostname: 'node02' + env: + # enter the target node name + - name: TARGET_NODE + value: {{ compute_chaos }} + - name: TOTAL_CHAOS_DURATION + value: 120s diff --git a/roles/onap-chaos-tests/templates/node-drain-rbac.yaml.j2 b/roles/onap-chaos-tests/templates/node-drain-rbac.yaml.j2 new file mode 100644 index 0000000..d7e4a78 --- /dev/null +++ b/roles/onap-chaos-tests/templates/node-drain-rbac.yaml.j2 @@ -0,0 +1,53 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: node-drain-sa + namespace: {{ onap_namespace }} + labels: + name: node-drain-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: node-drain-sa + labels: + name: node-drain-sa + app.kubernetes.io/part-of: litmus +rules: +- apiGroups: [""] + resources: ["pods","events"] + verbs: ["create","list","get","patch","update","delete","deletecollection"] +- apiGroups: [""] + resources: ["pods/exec","pods/log","pods/eviction"] + verbs: ["list","get","create"] +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] +- apiGroups: ["apps"] + resources: ["daemonsets"] + verbs: ["list","get","delete"] +- apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["patch","get","list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: node-drain-sa + labels: + name: node-drain-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: node-drain-sa +subjects: +- kind: ServiceAccount + name: node-drain-sa + namespace: {{ onap_namespace }} + diff --git a/roles/onap-chaos-tests/templates/node-memory-hog-chaos.yaml.j2 b/roles/onap-chaos-tests/templates/node-memory-hog-chaos.yaml.j2 new file mode 100644 index 0000000..fb39b9b --- /dev/null +++ b/roles/onap-chaos-tests/templates/node-memory-hog-chaos.yaml.j2 @@ -0,0 +1,32 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: node-memory-hog + namespace: {{ onap_namespace }} +spec: + # It can be true/false + annotationCheck: 'false' + # It can be active/stop + engineState: 'active' + #ex. values: ns1:name=percona,ns2:run=nginx + auxiliaryAppInfo: '' + chaosServiceAccount: node-memory-hog-sa + # It can be delete/retain + jobCleanUpPolicy: 'delete' + experiments: + - name: node-memory-hog + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '120' + + ## Specify the size as percent of total node capacity Ex: '30' + ## Note: For consuming memory in mebibytes change the variable to MEMORY_CONSUMPTION_MEBIBYTES + - name: MEMORY_CONSUMPTION_PERCENTAGE + value: '30' + + # ENTER THE COMMA SEPARATED TARGET NODES NAME + - name: TARGET_NODES + value: {{ compute_chaos }} diff --git a/roles/onap-chaos-tests/templates/node-memory-hog-rbac.yaml.j2 b/roles/onap-chaos-tests/templates/node-memory-hog-rbac.yaml.j2 new file mode 100644 index 0000000..9b21e05 --- /dev/null +++ b/roles/onap-chaos-tests/templates/node-memory-hog-rbac.yaml.j2 @@ -0,0 +1,49 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: node-memory-hog-sa + namespace: {{ onap_namespace }} + labels: + name: node-memory-hog-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: node-memory-hog-sa + labels: + name: node-memory-hog-sa + app.kubernetes.io/part-of: litmus +rules: +- apiGroups: [""] + resources: ["pods","events"] + verbs: ["create","list","get","patch","update","delete","deletecollection"] +- apiGroups: [""] + resources: ["pods/exec","pods/log"] + verbs: ["create","list","get"] +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] +- apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update"] +- apiGroups: [""] + resources: ["nodes"] + verbs: ["get","list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: node-memory-hog-sa + labels: + name: node-memory-hog-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: node-memory-hog-sa +subjects: +- kind: ServiceAccount + name: node-memory-hog-sa + namespace: {{ onap_namespace }}
\ No newline at end of file diff --git a/roles/onap-chaos-tests/templates/pod-delete-aai-chaos.yaml.j2 b/roles/onap-chaos-tests/templates/pod-delete-aai-chaos.yaml.j2 new file mode 100644 index 0000000..1c6eb01 --- /dev/null +++ b/roles/onap-chaos-tests/templates/pod-delete-aai-chaos.yaml.j2 @@ -0,0 +1,35 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: aai-chaos + namespace: {{ onap_namespace }} +spec: + appinfo: + appns: {{ onap_namespace }} + applabel: 'component=onap-aai' + appkind: 'deployment' + # It can be active/stop + engineState: 'active' + chaosServiceAccount: pod-delete-sa + experiments: + - name: pod-delete + spec: + components: + env: + - name: TARGET_PODS + value: {{ pod_list.stdout_lines | join(', ') }} + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '30' + + # set chaos interval (in sec) as desired + - name: CHAOS_INTERVAL + value: '10' + + # pod failures without '--force' & default terminationGracePeriodSeconds + - name: FORCE + value: 'true' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '100' diff --git a/roles/onap-chaos-tests/templates/pod-delete-aai-rbac.yaml.j2 b/roles/onap-chaos-tests/templates/pod-delete-aai-rbac.yaml.j2 new file mode 100644 index 0000000..2b85d42 --- /dev/null +++ b/roles/onap-chaos-tests/templates/pod-delete-aai-rbac.yaml.j2 @@ -0,0 +1,57 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: pod-delete-sa + namespace: {{ onap_namespace }} + labels: + name: pod-delete-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: pod-delete-sa + namespace: {{ onap_namespace }} + labels: + name: pod-delete-sa + app.kubernetes.io/part-of: litmus +rules: +- apiGroups: [""] + resources: ["pods","events"] + verbs: ["create","list","get","patch","update","delete","deletecollection"] +- apiGroups: [""] + resources: ["pods/exec","pods/log","replicationcontrollers"] + verbs: ["create","list","get"] +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] +- apiGroups: ["apps"] + resources: ["deployments","statefulsets","daemonsets","replicasets"] + verbs: ["list","get"] +- apiGroups: ["apps.openshift.io"] + resources: ["deploymentconfigs"] + verbs: ["list","get"] +- apiGroups: ["argoproj.io"] + resources: ["rollouts"] + verbs: ["list","get"] +- apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: pod-delete-sa + namespace: {{ onap_namespace }} + labels: + name: pod-delete-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: pod-delete-sa +subjects: +- kind: ServiceAccount + name: pod-delete-sa + namespace: {{ onap_namespace }}
\ No newline at end of file diff --git a/roles/onap-chaos-tests/templates/pod-delete-rbac.yaml.j2 b/roles/onap-chaos-tests/templates/pod-delete-rbac.yaml.j2 new file mode 100644 index 0000000..2b85d42 --- /dev/null +++ b/roles/onap-chaos-tests/templates/pod-delete-rbac.yaml.j2 @@ -0,0 +1,57 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: pod-delete-sa + namespace: {{ onap_namespace }} + labels: + name: pod-delete-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: pod-delete-sa + namespace: {{ onap_namespace }} + labels: + name: pod-delete-sa + app.kubernetes.io/part-of: litmus +rules: +- apiGroups: [""] + resources: ["pods","events"] + verbs: ["create","list","get","patch","update","delete","deletecollection"] +- apiGroups: [""] + resources: ["pods/exec","pods/log","replicationcontrollers"] + verbs: ["create","list","get"] +- apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] +- apiGroups: ["apps"] + resources: ["deployments","statefulsets","daemonsets","replicasets"] + verbs: ["list","get"] +- apiGroups: ["apps.openshift.io"] + resources: ["deploymentconfigs"] + verbs: ["list","get"] +- apiGroups: ["argoproj.io"] + resources: ["rollouts"] + verbs: ["list","get"] +- apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: pod-delete-sa + namespace: {{ onap_namespace }} + labels: + name: pod-delete-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: pod-delete-sa +subjects: +- kind: ServiceAccount + name: pod-delete-sa + namespace: {{ onap_namespace }}
\ No newline at end of file |