Directory restructure to add scenarios and experiments (#559)
* Updated dir struture with scenarios and experiments dir Signed-off-by: Amit Kumar Das <amit.das@harness.io> * Added icons Signed-off-by: Amit Kumar Das <amit.das@harness.io>
This commit is contained in:
BIN
scenarios/icons/bank-of-anthos.png
Normal file
BIN
scenarios/icons/bank-of-anthos.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
scenarios/icons/pod-delete.png
Normal file
BIN
scenarios/icons/pod-delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 959 B |
BIN
scenarios/icons/pod-memory-hog.png
Normal file
BIN
scenarios/icons/pod-memory-hog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
scenarios/icons/podtato-head.png
Normal file
BIN
scenarios/icons/podtato-head.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 159 KiB |
BIN
scenarios/icons/sock-shop-promProbe.png
Normal file
BIN
scenarios/icons/sock-shop-promProbe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 240 KiB |
BIN
scenarios/icons/sock-shop.png
Normal file
BIN
scenarios/icons/sock-shop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 240 KiB |
39
scenarios/pod-delete/pod-delete.chartserviceversion.yaml
Normal file
39
scenarios/pod-delete/pod-delete.chartserviceversion.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2021-05-24T10:28:08Z
|
||||
name: pod-delete
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: pod-delete
|
||||
chartDescription: Deletes a k8s pod
|
||||
spec:
|
||||
displayName: Pod Delete
|
||||
categoryDescription: >
|
||||
Pod delete contains chaos to disrupt state of kubernetes resources. Experiments can inject random pod delete failures against specified application.
|
||||
experiments:
|
||||
- name: pod-delete
|
||||
description: "This experiment injects random pod delete failures against specified application."
|
||||
keywords:
|
||||
- Kubernetes
|
||||
- Podtato-head
|
||||
- Pod
|
||||
platforms:
|
||||
- GKE
|
||||
- Minikube
|
||||
- Packet(Kubeadm)
|
||||
- EKS
|
||||
- AKS
|
||||
maintainers:
|
||||
- name: oumkale
|
||||
email: oumkale@chaosnative.com
|
||||
provider:
|
||||
name: ChaosNative
|
||||
links:
|
||||
- name: Kubernetes Slack
|
||||
url: https://slack.kubernetes.io/
|
||||
- name: Documentation
|
||||
url: https://docs.litmuschaos.io/docs/chaoshub/#generic-chaos
|
||||
icon:
|
||||
- url:
|
||||
mediatype: ""
|
159
scenarios/pod-delete/workflow.yaml
Normal file
159
scenarios/pod-delete/workflow.yaml
Normal file
@@ -0,0 +1,159 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: argowf-chaos-pod-delete-
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: appNamespace
|
||||
value: "kube-system"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-experiment
|
||||
template: install-experiment
|
||||
- - name: run-chaos
|
||||
template: run-chaos
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
|
||||
- name: install-experiment
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: install-experiment
|
||||
path: /tmp/pod-delete.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Deletes a pod belonging to a deployment/statefulset/daemonset
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-delete
|
||||
spec:
|
||||
definition:
|
||||
scope: Namespaced
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "apps"
|
||||
- "batch"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "deployments"
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "configmaps"
|
||||
- "chaosengines"
|
||||
- "chaosexperiments"
|
||||
- "chaosresults"
|
||||
verbs:
|
||||
- "create"
|
||||
- "list"
|
||||
- "get"
|
||||
- "patch"
|
||||
- "update"
|
||||
- "delete"
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- "nodes"
|
||||
verbs:
|
||||
- "get"
|
||||
- "list"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
- ./experiments -name pod-delete
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '15'
|
||||
|
||||
# Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
|
||||
# provide the kill count
|
||||
- name: KILL_COUNT
|
||||
value: ''
|
||||
|
||||
- name: FORCE
|
||||
value: 'true'
|
||||
|
||||
- name: CHAOS_INTERVAL
|
||||
value: '5'
|
||||
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
labels:
|
||||
name: pod-delete
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl apply -f /tmp/pod-delete.yaml -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
||||
|
||||
- name: run-chaos
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: run-chaos
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: kube-proxy-pod-delete-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: kube-system
|
||||
applabel: "k8s-app=kube-proxy"
|
||||
appkind: daemonset
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
experiments:
|
||||
- name: pod-delete
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: "60"
|
||||
- name: CHAOS_INTERVAL
|
||||
value: "10"
|
||||
- name: FORCE
|
||||
value: "false"
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine kube-proxy-pod-delete-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
163
scenarios/pod-delete/workflow_cron.yaml
Normal file
163
scenarios/pod-delete/workflow_cron.yaml
Normal file
@@ -0,0 +1,163 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: CronWorkflow
|
||||
metadata:
|
||||
name: argo-chaos-pod-delete-cron-wf
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
schedule: "0 * * * *"
|
||||
concurrencyPolicy: "Forbid"
|
||||
startingDeadlineSeconds: 0
|
||||
workflowSpec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: appNamespace
|
||||
value: "kube-system"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-experiment
|
||||
template: install-experiment
|
||||
- - name: run-chaos
|
||||
template: run-chaos
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
|
||||
- name: install-experiment
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: install-experiment
|
||||
path: /tmp/pod-delete.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Deletes a pod belonging to a deployment/statefulset/daemonset
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-delete
|
||||
spec:
|
||||
definition:
|
||||
scope: Namespaced
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "apps"
|
||||
- "batch"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "deployments"
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "configmaps"
|
||||
- "chaosengines"
|
||||
- "chaosexperiments"
|
||||
- "chaosresults"
|
||||
verbs:
|
||||
- "create"
|
||||
- "list"
|
||||
- "get"
|
||||
- "patch"
|
||||
- "update"
|
||||
- "delete"
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- "nodes"
|
||||
verbs:
|
||||
- "get"
|
||||
- "list"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
- ./experiments -name pod-delete
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '15'
|
||||
|
||||
# Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
|
||||
# provide the kill count
|
||||
- name: KILL_COUNT
|
||||
value: ''
|
||||
|
||||
- name: FORCE
|
||||
value: 'true'
|
||||
|
||||
- name: CHAOS_INTERVAL
|
||||
value: '5'
|
||||
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
labels:
|
||||
name: pod-delete
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl apply -f /tmp/pod-delete.yaml -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
||||
|
||||
- name: run-chaos
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: run-chaos
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: kube-proxy-pod-delete-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: kube-system
|
||||
applabel: "k8s-app=kube-proxy"
|
||||
appkind: daemonset
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
experiments:
|
||||
- name: pod-delete
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: "60"
|
||||
- name: CHAOS_INTERVAL
|
||||
value: "10"
|
||||
- name: FORCE
|
||||
value: "false"
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine kube-proxy-pod-delete-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
@@ -0,0 +1,40 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2021-05-24T10:28:08Z
|
||||
name: pod-memory-hog
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: pod-memory-hog
|
||||
chartDescription: Injects memory chaos on a k8s pod
|
||||
spec:
|
||||
displayName: Pod Memory Hog
|
||||
categoryDescription: >
|
||||
Pod-Memory-Hog contains chaos to consume memory resouces of specified containers in Kubernetes pods
|
||||
and revert the chaos
|
||||
experiments:
|
||||
- name: pod-memory-hog
|
||||
description: "Injects memory chaos on a k8s pod"
|
||||
keywords:
|
||||
- Kubernetes
|
||||
- Podtato-head
|
||||
- Pod
|
||||
platforms:
|
||||
- GKE
|
||||
- Minikube
|
||||
- Packet(Kubeadm)
|
||||
- EKS
|
||||
- AKS
|
||||
maintainers:
|
||||
- name: oumkale
|
||||
email: oumkale@chaosnative.com
|
||||
provider:
|
||||
name: ChaosNative
|
||||
links:
|
||||
- name: Kubernetes Slack
|
||||
url: https://slack.kubernetes.io/
|
||||
- name: Documentation
|
||||
url: https://docs.litmuschaos.io/docs/chaoshub/#generic-chaos
|
||||
icon:
|
||||
- url:
|
||||
mediatype: ""
|
159
scenarios/pod-memory-hog/workflow.yaml
Normal file
159
scenarios/pod-memory-hog/workflow.yaml
Normal file
@@ -0,0 +1,159 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: argowf-chaos-pod-memory-hog-
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: appNamespace
|
||||
value: "kube-system"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-experiment
|
||||
template: install-experiment
|
||||
- - name: run-chaos
|
||||
template: run-chaos
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
|
||||
- name: install-experiment
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: install-experiment
|
||||
path: /tmp/pod-memory-hog.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Injects memory consumption on pods belonging to an app deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-memory-hog
|
||||
spec:
|
||||
definition:
|
||||
scope: Namespaced
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "batch"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "chaosengines"
|
||||
- "chaosexperiments"
|
||||
- "chaosresults"
|
||||
verbs:
|
||||
- "create"
|
||||
- "list"
|
||||
- "get"
|
||||
- "patch"
|
||||
- "update"
|
||||
- "delete"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
args:
|
||||
- -c
|
||||
- ./experiments -name pod-memory-hog
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '30'
|
||||
|
||||
- name: CHAOS_INTERVAL
|
||||
value: '10'
|
||||
|
||||
## enter the amount of memory in megabytes to be consumed by the application pod
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
## percentage of total pods to target
|
||||
- name: PODS_AFFECTED_PERC
|
||||
value: ''
|
||||
|
||||
## Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
|
||||
## env var that describes the library used to execute the chaos
|
||||
## default: litmus. Supported values: litmus, powerfulseal, chaoskube
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
|
||||
- name: TARGET_POD
|
||||
value: ''
|
||||
|
||||
labels:
|
||||
name: pod-memory-hog
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl apply -f /tmp/pod-memory-hog.yaml -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
||||
|
||||
- name: run-chaos
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: run-chaos
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: kube-proxy-pod-memory-hog-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: kube-system
|
||||
applabel: "k8s-app=kube-proxy"
|
||||
appkind: daemonset
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
experiments:
|
||||
- name: pod-memory-hog
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
- name: TARGET_CONTAINER
|
||||
value: 'kube-proxy'
|
||||
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
|
||||
- name: CHAOS_KILL_COMMAND
|
||||
value: "kill -9 $(ps afx | grep \"[dd] if /dev/zero\" | awk '{print $1}' | tr '\n' ' ')"
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine kube-proxy-pod-memory-hog-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
163
scenarios/pod-memory-hog/workflow_cron.yaml
Normal file
163
scenarios/pod-memory-hog/workflow_cron.yaml
Normal file
@@ -0,0 +1,163 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: CronWorkflow
|
||||
metadata:
|
||||
name: argo-chaos-pod-memory-cron-wf
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
schedule: "0 * * * *"
|
||||
concurrencyPolicy: "Forbid"
|
||||
startingDeadlineSeconds: 0
|
||||
workflowSpec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: appNamespace
|
||||
value: "kube-system"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-experiment
|
||||
template: install-experiment
|
||||
- - name: run-chaos
|
||||
template: run-chaos
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
|
||||
- name: install-experiment
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: install-experiment
|
||||
path: /tmp/pod-memory-hog.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Injects memory consumption on pods belonging to an app deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-memory-hog
|
||||
spec:
|
||||
definition:
|
||||
scope: Namespaced
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "batch"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "chaosengines"
|
||||
- "chaosexperiments"
|
||||
- "chaosresults"
|
||||
verbs:
|
||||
- "create"
|
||||
- "list"
|
||||
- "get"
|
||||
- "patch"
|
||||
- "update"
|
||||
- "delete"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
args:
|
||||
- -c
|
||||
- ./experiments -name pod-memory-hog
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '30'
|
||||
|
||||
- name: CHAOS_INTERVAL
|
||||
value: '10'
|
||||
|
||||
## enter the amount of memory in megabytes to be consumed by the application pod
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
## percentage of total pods to target
|
||||
- name: PODS_AFFECTED_PERC
|
||||
value: ''
|
||||
|
||||
## Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
|
||||
## env var that describes the library used to execute the chaos
|
||||
## default: litmus. Supported values: litmus, powerfulseal, chaoskube
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
|
||||
- name: TARGET_POD
|
||||
value: ''
|
||||
|
||||
labels:
|
||||
name: pod-memory-hog
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl apply -f /tmp/pod-memory-hog.yaml -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
||||
|
||||
- name: run-chaos
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: run-chaos
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: kube-proxy-pod-memory-hog-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.appNamespace}}_kube-proxy"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: kube-system
|
||||
applabel: "k8s-app=kube-proxy"
|
||||
appkind: daemonset
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
experiments:
|
||||
- name: pod-memory-hog
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
- name: TARGET_CONTAINER
|
||||
value: 'kube-proxy'
|
||||
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
|
||||
- name: CHAOS_KILL_COMMAND
|
||||
value: "kill -9 $(ps afx | grep \"[dd] if /dev/zero\" | awk '{print $1}' | tr '\n' ' ')"
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine kube-proxy-pod-memory-hog-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
40
scenarios/podtato-head/podtato-head.chartserviceversion.yaml
Normal file
40
scenarios/podtato-head/podtato-head.chartserviceversion.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2021-05-24T10:28:08Z
|
||||
name: podtato-head
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: podtato-head
|
||||
chartDescription: Injects chaos on podtato-head application
|
||||
spec:
|
||||
displayName: Podtato-head Chaos
|
||||
categoryDescription: >
|
||||
It install podtato-head application, inject chaos on podtato-head, uninstall the application
|
||||
and revert the chaos
|
||||
experiments:
|
||||
- name: pod-delete
|
||||
description: "Deletes a k8s pod"
|
||||
keywords:
|
||||
- Kubernetes
|
||||
- Podtato-head
|
||||
- Pod
|
||||
platforms:
|
||||
- GKE
|
||||
- Minikube
|
||||
- Packet(Kubeadm)
|
||||
- EKS
|
||||
- AKS
|
||||
maintainers:
|
||||
- name: oumkale
|
||||
email: oumkale@chaosnative.com
|
||||
provider:
|
||||
name: ChaosNative
|
||||
links:
|
||||
- name: Kubernetes Slack
|
||||
url: https://slack.kubernetes.io/
|
||||
- name: Documentation
|
||||
url: https://docs.litmuschaos.io/docs/chaoshub/#generic-chaos
|
||||
icon:
|
||||
- url:
|
||||
mediatype: ""
|
114
scenarios/podtato-head/workflow.yaml
Normal file
114
scenarios/podtato-head/workflow.yaml
Normal file
@@ -0,0 +1,114 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: argowf-podtato-head-chaos-
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject : "{{workflow.parameters.adminModeNamespace}}_podtato-main"
|
||||
spec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-application
|
||||
template: install-application
|
||||
- - name: install-chaos-experiments
|
||||
template: install-chaos-experiments
|
||||
- - name: pod-delete
|
||||
template: pod-delete
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
- name: delete-application
|
||||
template: delete-application
|
||||
|
||||
- name: install-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace={{workflow.parameters.adminModeNamespace}}","-typeName=resilient","-operation=apply","-timeout=400", "-app=podtato-head","-scope=namespace"]
|
||||
|
||||
- name: install-chaos-experiments
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
- "kubectl apply -f https://hub.litmuschaos.io/api/chaos/master?file=charts/generic/experiments.yaml -n
|
||||
{{workflow.parameters.adminModeNamespace}} ; sleep 30"
|
||||
|
||||
- name: pod-delete
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: pod-delete
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: podtato-main-pod-delete-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.adminModeNamespace}}_podtato-main"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: {{workflow.parameters.adminModeNamespace}}
|
||||
applabel: 'name=podtato-main'
|
||||
appkind: 'deployment'
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
jobCleanUpPolicy: 'retain'
|
||||
components:
|
||||
runner:
|
||||
imagePullPolicy: Always
|
||||
experiments:
|
||||
- name: pod-delete
|
||||
spec:
|
||||
probe:
|
||||
- name: "check-podtato-main-access-url"
|
||||
type: "httpProbe"
|
||||
httpProbe/inputs:
|
||||
url: "http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000"
|
||||
insecureSkipVerify: false
|
||||
method:
|
||||
get:
|
||||
criteria: "=="
|
||||
responseCode: "200"
|
||||
mode: "Continuous"
|
||||
runProperties:
|
||||
probeTimeout: 1
|
||||
interval: 1
|
||||
retry: 1
|
||||
components:
|
||||
env:
|
||||
- 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: 'false'
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: delete-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace={{workflow.parameters.adminModeNamespace}}","-typeName=resilient","-operation=delete","-app=podtato-head"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine podtato-main-pod-delete-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
118
scenarios/podtato-head/workflow_cron.yaml
Normal file
118
scenarios/podtato-head/workflow_cron.yaml
Normal file
@@ -0,0 +1,118 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: CronWorkflow
|
||||
metadata:
|
||||
name: argowf-podtato-head-chaos-cron-wf
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject : "{{workflow.parameters.adminModeNamespace}}_podtato-head"
|
||||
spec:
|
||||
schedule: "0 * * * *"
|
||||
concurrencyPolicy: "Forbid"
|
||||
startingDeadlineSeconds: 0
|
||||
workflowSpec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
templates:
|
||||
- name: argowf-chaos
|
||||
steps:
|
||||
- - name: install-application
|
||||
template: install-application
|
||||
- - name: install-chaos-experiments
|
||||
template: install-chaos-experiments
|
||||
- - name: pod-delete
|
||||
template: pod-delete
|
||||
- - name: revert-chaos
|
||||
template: revert-chaos
|
||||
- name: delete-application
|
||||
template: delete-application
|
||||
|
||||
- name: install-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace={{workflow.parameters.adminModeNamespace}}","-typeName=resilient","-operation=apply","-timeout=400", "-app=podtato-head","-scope=namespace"]
|
||||
|
||||
- name: install-chaos-experiments
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
- "kubectl apply -f https://hub.litmuschaos.io/api/chaos/master?file=charts/generic/experiments.yaml -n
|
||||
{{workflow.parameters.adminModeNamespace}} ; sleep 30"
|
||||
|
||||
- name: pod-delete
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: pod-delete
|
||||
path: /tmp/chaosengine.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChaosEngine
|
||||
metadata:
|
||||
name: podtato-main-pod-delete-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.adminModeNamespace}}_podtato-main"
|
||||
spec:
|
||||
appinfo:
|
||||
appns: {{workflow.parameters.adminModeNamespace}}
|
||||
applabel: 'name=podtato-main'
|
||||
appkind: 'deployment'
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
jobCleanUpPolicy: 'retain'
|
||||
components:
|
||||
runner:
|
||||
imagePullPolicy: Always
|
||||
experiments:
|
||||
- name: pod-delete
|
||||
spec:
|
||||
probe:
|
||||
- name: "check-podtato-main-access-url"
|
||||
type: "httpProbe"
|
||||
httpProbe/inputs:
|
||||
url: "http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000"
|
||||
insecureSkipVerify: false
|
||||
method:
|
||||
get:
|
||||
criteria: "=="
|
||||
responseCode: "200"
|
||||
mode: "Continuous"
|
||||
runProperties:
|
||||
probeTimeout: 1
|
||||
interval: 1
|
||||
retry: 1
|
||||
components:
|
||||
env:
|
||||
- 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: 'false'
|
||||
container:
|
||||
image: litmuschaos/litmus-checker:latest
|
||||
args: ["-file=/tmp/chaosengine.yaml","-saveName=/tmp/engine-name"]
|
||||
|
||||
- name: delete-application
|
||||
container:
|
||||
image: litmuschaos/litmus-app-deployer:latest
|
||||
args: ["-namespace={{workflow.parameters.adminModeNamespace}}","-typeName=resilient","-operation=delete","-app=podtato-head"]
|
||||
|
||||
- name: revert-chaos
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl delete chaosengine podtato-main-pod-delete-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
Reference in New Issue
Block a user