Chore(stress-chaos): Add stress chaos charts (#475)
Signed-off-by: udit <udit@chaosnative.com> Co-authored-by: Shubham Chaudhary <shubham.chaudhary@mayadata.io>
This commit is contained in:
@@ -37,6 +37,8 @@ spec:
|
||||
- node-restart
|
||||
- pod-dns-error
|
||||
- pod-dns-spoof
|
||||
- pod-cpu-hog-exec
|
||||
- pod-memory-hog-exec
|
||||
|
||||
keywords:
|
||||
- Kubernetes
|
||||
|
@@ -72,3 +72,9 @@ experiments:
|
||||
- name: pod-dns-spoof
|
||||
CSV: pod-dns-spoof.chartserviceversion.yaml
|
||||
desc: "pod-dns-spoof"
|
||||
- name: pod-cpu-hog-exec
|
||||
CSV: pod-cpu-hog-exec.chartserviceversion.yaml
|
||||
desc: "pod-cpu-hog-exec"
|
||||
- name: pod-memory-hog-exec
|
||||
CSV: pod-memory-hog-exec.chartserviceversion.yaml
|
||||
desc: "pod-memory-hog-exec"
|
||||
|
BIN
charts/generic/icons/pod-cpu-hog-exec.png
Normal file
BIN
charts/generic/icons/pod-cpu-hog-exec.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
charts/generic/icons/pod-memory-hog-exec.png
Normal file
BIN
charts/generic/icons/pod-memory-hog-exec.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@@ -6,28 +6,20 @@ metadata:
|
||||
spec:
|
||||
# It can be active/stop
|
||||
engineState: 'active'
|
||||
#ex. values: ns1:name=percona,ns2:run=nginx
|
||||
auxiliaryAppInfo: ''
|
||||
appinfo:
|
||||
appns: 'default'
|
||||
applabel: 'app=nginx'
|
||||
appkind: 'deployment'
|
||||
chaosServiceAccount: pod-cpu-hog-sa
|
||||
chaosServiceAccount: pod-cpu-hog-exec-sa
|
||||
experiments:
|
||||
- name: pod-cpu-hog
|
||||
- name: pod-cpu-hog-exec
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# Provide name of target container
|
||||
# where chaos has to be injected
|
||||
- name: TARGET_CONTAINER
|
||||
value: 'nginx'
|
||||
|
||||
#number of cpu cores to be consumed
|
||||
#verify the resources the app has been launched with
|
||||
- name: CPU_CORES
|
||||
value: '1'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
|
||||
value: '60' # in seconds
|
@@ -4,9 +4,9 @@ description:
|
||||
Injects cpu consumption on pods belonging to an app deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-cpu-hog
|
||||
name: pod-cpu-hog-exec
|
||||
labels:
|
||||
name: pod-cpu-hog
|
||||
name: pod-cpu-hog-exec
|
||||
app.kubernetes.io/part-of: litmus
|
||||
app.kubernetes.io/component: chaosexperiment
|
||||
app.kubernetes.io/version: latest
|
||||
@@ -17,12 +17,23 @@ spec:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "batch"
|
||||
- "apps"
|
||||
- "apps.openshift.io"
|
||||
- "argoproj.io"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "replicationcontrollers"
|
||||
- "deployments"
|
||||
- "statefulsets"
|
||||
- "daemonsets"
|
||||
- "replicasets"
|
||||
- "deploymentconfigs"
|
||||
- "rollouts"
|
||||
- "pods/exec"
|
||||
- "chaosengines"
|
||||
- "chaosexperiments"
|
||||
- "chaosresults"
|
||||
@@ -33,37 +44,45 @@ spec:
|
||||
- "patch"
|
||||
- "update"
|
||||
- "delete"
|
||||
image: "litmuschaos/ansible-runner:latest"
|
||||
- "deletecollection"
|
||||
image: "litmuschaos/go-runner:ci"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
- ansible-playbook ./experiments/generic/pod_cpu_hog/pod_cpu_hog_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
|
||||
- ./experiments -name pod-cpu-hog-exec
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
- name: ANSIBLE_STDOUT_CALLBACK
|
||||
value: 'default'
|
||||
|
||||
- name: TARGET_CONTAINER
|
||||
value: ''
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
|
||||
## Number of CPU cores to stress
|
||||
- name: CPU_CORES
|
||||
value: '1'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
## Percentage of total pods to target
|
||||
- name: PODS_AFFECTED_PERC
|
||||
value: ''
|
||||
|
||||
# Period to wait before injection of chaos in sec
|
||||
## 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
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/app-cpu-stress:latest'
|
||||
- name: TARGET_PODS
|
||||
value: ''
|
||||
|
||||
## it defines the sequence of chaos execution for multiple target pods
|
||||
## supported values: serial, parallel
|
||||
- name: SEQUENCE
|
||||
value: 'parallel'
|
||||
|
||||
labels:
|
||||
name: pod-cpu-hog
|
||||
name: pod-cpu-hog-exec
|
||||
app.kubernetes.io/part-of: litmus
|
||||
app.kubernetes.io/component: experiment-job
|
||||
app.kubernetes.io/version: latest
|
@@ -0,0 +1,47 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2021-06-16T10:28:08Z
|
||||
name: pod-cpu-hog-exec
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: Kubernetes
|
||||
vendor: CNCF
|
||||
support: https://slack.kubernetes.io/
|
||||
spec:
|
||||
displayName: pod-cpu-hog-exec
|
||||
categoryDescription: |
|
||||
pod-cpu-hog-exec contains chaos to consume CPU resouces of specified containers in Kubernetes pods.
|
||||
- Causes high CPU resource consumption utilizing one or more cores by triggering md5sum commands
|
||||
- The application pod should be healthy once chaos is stopped. Expectation is that service-requests should be served despite chaos.
|
||||
keywords:
|
||||
- Kubernetes
|
||||
- CPU
|
||||
platforms:
|
||||
- GKE
|
||||
- Packet(Kubeadm)
|
||||
- Minikube
|
||||
- EKS
|
||||
- AKS
|
||||
- Kind
|
||||
maturity: alpha
|
||||
maintainers:
|
||||
- name: ksatchit
|
||||
email: karthik@chaosnative.com
|
||||
minKubeVersion: 1.12.0
|
||||
provider:
|
||||
name: ChaosNative
|
||||
labels:
|
||||
app.kubernetes.io/component: chartserviceversion
|
||||
app.kubernetes.io/version: latest
|
||||
links:
|
||||
- name: Source Code
|
||||
url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/generic/pod-cpu-hog-exec
|
||||
- name: Documentation
|
||||
url: https://docs.litmuschaos.io/docs/pod-cpu-hog-exec/
|
||||
- name: Video
|
||||
url: https://www.youtube.com/watch?v=MBGSPmZKb2I
|
||||
icon:
|
||||
- base64data: ""
|
||||
mediatype: ""
|
||||
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/pod-cpu-hog-exec/experiment.yaml
|
61
charts/generic/pod-cpu-hog-exec/rbac-psp.yaml
Normal file
61
charts/generic/pod-cpu-hog-exec/rbac-psp.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-exec-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"]
|
||||
- apiGroups: ["policy"]
|
||||
resources: ["podsecuritypolicies"]
|
||||
verbs: ["use"]
|
||||
resourceNames: ["litmus"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: pod-cpu-hog-exec-sa
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
57
charts/generic/pod-cpu-hog-exec/rbac.yaml
Normal file
57
charts/generic/pod-cpu-hog-exec/rbac.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-exec-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-cpu-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: pod-cpu-hog-exec-sa
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pod-cpu-hog-exec-sa
|
||||
namespace: default
|
@@ -1,39 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pod-cpu-hog-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: pod-cpu-hog-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
rules:
|
||||
- apiGroups: ["","litmuschaos.io","batch"]
|
||||
resources: ["pods","jobs","events","pods/log","chaosengines","chaosexperiments","chaosresults"]
|
||||
verbs: ["create","list","get","patch","update","delete"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: pod-cpu-hog-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-cpu-hog-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: pod-cpu-hog-sa
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pod-cpu-hog-sa
|
||||
namespace: default
|
@@ -17,10 +17,8 @@ spec:
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
#number of cpu cores to be consumed
|
||||
#verify the resources the app has been launched with
|
||||
- name: CPU_CORES
|
||||
value: '1'
|
||||
value: '1'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
value: '60' # in seconds
|
||||
|
@@ -45,7 +45,7 @@ spec:
|
||||
- "update"
|
||||
- "delete"
|
||||
- "deletecollection"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
image: "litmuschaos/go-runner:ci"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
@@ -58,7 +58,7 @@ spec:
|
||||
|
||||
## Number of CPU cores to stress
|
||||
- name: CPU_CORES
|
||||
value: '1'
|
||||
value: '1'
|
||||
|
||||
## Percentage of total pods to target
|
||||
- name: PODS_AFFECTED_PERC
|
||||
@@ -75,11 +75,15 @@ spec:
|
||||
|
||||
## It is used in pumba lib only
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/go-runner:latest'
|
||||
value: 'litmuschaos/go-runner:ci'
|
||||
|
||||
## It is used in pumba lib only
|
||||
- name: STRESS_IMAGE
|
||||
value: 'alexeiled/stress-ng:latest-ubuntu'
|
||||
value: 'alexeiled/stress-ng:latest-ubuntu'
|
||||
|
||||
## provide the cluster runtime
|
||||
- name: CONTAINER_RUNTIME
|
||||
value: 'docker'
|
||||
|
||||
# provide the socket file path
|
||||
# it is used in pumba lib
|
||||
|
@@ -1,9 +1,9 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2019-01-07T10:28:08Z
|
||||
createdAt: 2021-06-16T10:28:08Z
|
||||
name: pod-cpu-hog
|
||||
version: 0.1.8
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: Kubernetes
|
||||
vendor: CNCF
|
||||
@@ -11,8 +11,9 @@ metadata:
|
||||
spec:
|
||||
displayName: pod-cpu-hog
|
||||
categoryDescription: |
|
||||
Pod-CPU-Hog contains chaos to consume CPU resouces of specified containers in Kubernetes pods.
|
||||
- Causes high CPU resource consumption utilizing one or more cores by triggering md5sum commands
|
||||
Pod-CPU-Hog contains chaos to consume CPU resouces of specified containers in Kubernetes pods.
|
||||
- Causes CPU resource consumption on specified application containers using cgroups and litmus nsutil which consume CPU resources of the given target containers.
|
||||
- It Can test the application's resilience to potential slowness/unavailability of some replicas due to high CPU load
|
||||
- The application pod should be healthy once chaos is stopped. Expectation is that service-requests should be served despite chaos.
|
||||
keywords:
|
||||
- Kubernetes
|
||||
@@ -27,10 +28,12 @@ spec:
|
||||
maturity: alpha
|
||||
maintainers:
|
||||
- name: ksatchit
|
||||
email: karthik.s@mayadata.io
|
||||
email: karthik@chaosnative.com
|
||||
- name: Udit Gaurav
|
||||
email: udit@chaosnative.com
|
||||
minKubeVersion: 1.12.0
|
||||
provider:
|
||||
name: Mayadata
|
||||
name: ChaosNative
|
||||
labels:
|
||||
app.kubernetes.io/component: chartserviceversion
|
||||
app.kubernetes.io/version: latest
|
||||
|
@@ -46,7 +46,7 @@ spec:
|
||||
- "update"
|
||||
- "delete"
|
||||
- "deletecollection"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
image: "litmuschaos/go-runner:ci"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
@@ -88,16 +88,19 @@ spec:
|
||||
value: ''
|
||||
|
||||
# Provide the LIB here
|
||||
# Only pumba supported
|
||||
# support litmus and pumba
|
||||
- name: LIB
|
||||
value: 'pumba'
|
||||
value: 'litmus'
|
||||
|
||||
# provide lib image
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/go-runner:latest'
|
||||
value: 'litmuschaos/go-runner:ci'
|
||||
|
||||
## provide the cluster runtime
|
||||
- name: CONTAINER_RUNTIME
|
||||
value: 'docker'
|
||||
|
||||
# provide the socket file path
|
||||
# it is used in pumba lib
|
||||
- name: SOCKET_PATH
|
||||
value: '/var/run/docker.sock'
|
||||
|
||||
|
@@ -6,28 +6,20 @@ metadata:
|
||||
spec:
|
||||
# It can be active/stop
|
||||
engineState: 'active'
|
||||
#ex. values: ns1:name=percona,ns2:run=nginx
|
||||
auxiliaryAppInfo: ''
|
||||
appinfo:
|
||||
appns: 'default'
|
||||
applabel: 'app=nginx'
|
||||
appkind: 'deployment'
|
||||
chaosServiceAccount: pod-memory-hog-sa
|
||||
chaosServiceAccount: pod-memory-hog-exec-sa
|
||||
experiments:
|
||||
- name: pod-memory-hog
|
||||
- name: pod-memory-hog-exec
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# Provide name of target container
|
||||
# where chaos has to be injected
|
||||
- name: TARGET_CONTAINER
|
||||
value: 'nginx'
|
||||
|
||||
# Enter the amount of memory in megabytes to be consumed by the application pod
|
||||
# default: 500 (Megabytes)
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
|
||||
|
89
charts/generic/pod-memory-hog-exec/experiment.yaml
Normal file
89
charts/generic/pod-memory-hog-exec/experiment.yaml
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Injects memory consumption on pods belonging to an app deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-memory-hog-exec
|
||||
labels:
|
||||
name: pod-memory-hog-exec
|
||||
app.kubernetes.io/part-of: litmus
|
||||
app.kubernetes.io/component: chaosexperiment
|
||||
app.kubernetes.io/version: latest
|
||||
spec:
|
||||
definition:
|
||||
scope: Namespaced
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "batch"
|
||||
- "apps"
|
||||
- "apps.openshift.io"
|
||||
- "argoproj.io"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "replicationcontrollers"
|
||||
- "deployments"
|
||||
- "statefulsets"
|
||||
- "daemonsets"
|
||||
- "replicasets"
|
||||
- "deploymentconfigs"
|
||||
- "rollouts"
|
||||
- "pods/exec"
|
||||
- "events"
|
||||
- "chaosengines"
|
||||
- "chaosexperiments"
|
||||
- "chaosresults"
|
||||
verbs:
|
||||
- "create"
|
||||
- "list"
|
||||
- "get"
|
||||
- "patch"
|
||||
- "update"
|
||||
- "delete"
|
||||
- "deletecollection"
|
||||
image: "litmuschaos/go-runner:ci"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
- ./experiments -name pod-memory-hog-exec
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
|
||||
## 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
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
|
||||
## it defines the sequence of chaos execution for multiple target pods
|
||||
## supported values: serial, parallel
|
||||
- name: SEQUENCE
|
||||
value: 'parallel'
|
||||
|
||||
- name: TARGET_PODS
|
||||
value: ''
|
||||
|
||||
labels:
|
||||
name: pod-memory-hog-exec
|
||||
app.kubernetes.io/part-of: litmus
|
||||
app.kubernetes.io/component: experiment-job
|
||||
app.kubernetes.io/version: latest
|
@@ -0,0 +1,47 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2020-04-10T10:28:08Z
|
||||
name: pod-memory-hog-exec
|
||||
version: 0.1.4
|
||||
annotations:
|
||||
categories: Kubernetes
|
||||
vendor: CNCF
|
||||
support: https://slack.kubernetes.io/
|
||||
spec:
|
||||
displayName: pod-memory-hog-exec
|
||||
categoryDescription: |
|
||||
pod-memory-hog-exec contains chaos to consume Memory resouces of specified containers in Kubernetes pods.
|
||||
- Consumes the memory specified by executing a dd command against special files /dev/zero(input) and /dev/null(output)
|
||||
- The application pod should be healthy once chaos is stopped. Expectation is that service-requests should be served despite chaos.
|
||||
keywords:
|
||||
- Kubernetes
|
||||
- Memory
|
||||
platforms:
|
||||
- GKE
|
||||
- Packet(Kubeadm)
|
||||
- Minikube
|
||||
- EKS
|
||||
- AKS
|
||||
- OpenShift(OKD)
|
||||
maturity: alpha
|
||||
maintainers:
|
||||
- name: Udit Gaurav
|
||||
email: udit@chaosnative.com
|
||||
minKubeVersion: 1.12.0
|
||||
provider:
|
||||
name: ChaosNative
|
||||
labels:
|
||||
app.kubernetes.io/component: chartserviceversion
|
||||
app.kubernetes.io/version: latest
|
||||
links:
|
||||
- name: Source Code
|
||||
url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/generic/pod-memory-hog-exec
|
||||
- name: Documentation
|
||||
url: https://docs.litmuschaos.io/docs/pod-memory-hog-exec/
|
||||
- name: Video
|
||||
url: https://www.youtube.com/watch?v=HuAXg8W5Tzo
|
||||
icon:
|
||||
- base64data: ""
|
||||
mediatype: ""
|
||||
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/pod-memory-hog-exec/experiment.yaml
|
61
charts/generic/pod-memory-hog-exec/rbac-psp.yaml
Normal file
61
charts/generic/pod-memory-hog-exec/rbac-psp.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-exec-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"]
|
||||
- apiGroups: ["policy"]
|
||||
resources: ["podsecuritypolicies"]
|
||||
verbs: ["use"]
|
||||
resourceNames: ["litmus"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: pod-memory-hog-exec-sa
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
57
charts/generic/pod-memory-hog-exec/rbac.yaml
Normal file
57
charts/generic/pod-memory-hog-exec/rbac.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-exec-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-memory-hog-exec-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-exec-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: pod-memory-hog-exec-sa
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pod-memory-hog-exec-sa
|
||||
namespace: default
|
@@ -1,73 +0,0 @@
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Injects memory consumption on pods belonging to an app deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: pod-memory-hog
|
||||
labels:
|
||||
name: pod-memory-hog
|
||||
app.kubernetes.io/part-of: litmus
|
||||
app.kubernetes.io/component: chaosexperiment
|
||||
app.kubernetes.io/version: latest
|
||||
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/ansible-runner:latest"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
- ansible-playbook ./experiments/generic/pod_memory_hog/pod_memory_hog_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
- name: ANSIBLE_STDOUT_CALLBACK
|
||||
value: 'default'
|
||||
|
||||
# Provide name of target container
|
||||
# where chaos has to be injected
|
||||
- name: TARGET_CONTAINER
|
||||
value: ''
|
||||
|
||||
# Enter the amount of memory in megabytes to be consumed by the application pod
|
||||
# default: 500 (Megabytes)
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
|
||||
# Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
|
||||
- name: LIB
|
||||
value: 'litmus'
|
||||
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/app-memory-stress:latest'
|
||||
labels:
|
||||
name: pod-memory-hog
|
||||
app.kubernetes.io/part-of: litmus
|
||||
app.kubernetes.io/component: experiment-job
|
||||
app.kubernetes.io/version: latest
|
@@ -1,39 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: pod-memory-hog-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: pod-memory-hog-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
rules:
|
||||
- apiGroups: ["","litmuschaos.io","batch"]
|
||||
resources: ["pods","jobs","events","pods/log","chaosengines","chaosexperiments","chaosresults"]
|
||||
verbs: ["create","list","get","patch","update","delete"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: pod-memory-hog-sa
|
||||
namespace: default
|
||||
labels:
|
||||
name: pod-memory-hog-sa
|
||||
app.kubernetes.io/part-of: litmus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: pod-memory-hog-sa
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: pod-memory-hog-sa
|
||||
namespace: default
|
@@ -20,6 +20,8 @@ spec:
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
- name: NUMBER_OF_WORKERS
|
||||
value: '1'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
|
@@ -46,7 +46,7 @@ spec:
|
||||
- "update"
|
||||
- "delete"
|
||||
- "deletecollection"
|
||||
image: "litmuschaos/go-runner:latest"
|
||||
image: "litmuschaos/go-runner:ci"
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- -c
|
||||
@@ -60,6 +60,10 @@ spec:
|
||||
## enter the amount of memory in megabytes to be consumed by the application pod
|
||||
- name: MEMORY_CONSUMPTION
|
||||
value: '500'
|
||||
|
||||
## Number of workers to perform stress
|
||||
- name: NUMBER_OF_WORKERS
|
||||
value: '1'
|
||||
|
||||
## percentage of total pods to target
|
||||
- name: PODS_AFFECTED_PERC
|
||||
@@ -76,7 +80,7 @@ spec:
|
||||
|
||||
## It is used in pumba lib only
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/go-runner:latest'
|
||||
value: 'litmuschaos/go-runner:ci'
|
||||
|
||||
## It is used in pumba lib only
|
||||
- name: STRESS_IMAGE
|
||||
|
@@ -1,9 +1,9 @@
|
||||
apiVersion: litmuchaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
createdAt: 2020-04-10T10:28:08Z
|
||||
createdAt: 2021-06-16T10:28:08Z
|
||||
name: pod-memory-hog
|
||||
version: 0.1.4
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: Kubernetes
|
||||
vendor: CNCF
|
||||
@@ -11,8 +11,9 @@ metadata:
|
||||
spec:
|
||||
displayName: pod-memory-hog
|
||||
categoryDescription: |
|
||||
Pod-Memory-Hog contains chaos to consume Memory resouces of specified containers in Kubernetes pods.
|
||||
- Consumes the memory specified by executing a dd command against special files /dev/zero(input) and /dev/null(output)
|
||||
Pod-Memory-Hog contains chaos to consume memory resouces of specified containers in Kubernetes pods.
|
||||
- Causes memory resource consumption on specified application containers using cgroups and litmus nsutil that consume memory resources of the given target containers.
|
||||
- It Can test the application's resilience to potential slowness/unavailability of some replicas due to high memory load
|
||||
- The application pod should be healthy once chaos is stopped. Expectation is that service-requests should be served despite chaos.
|
||||
keywords:
|
||||
- Kubernetes
|
||||
@@ -27,10 +28,10 @@ spec:
|
||||
maturity: alpha
|
||||
maintainers:
|
||||
- name: Udit Gaurav
|
||||
email: udit.gaurav@mayadata.io
|
||||
email: udit@chaosnative.com
|
||||
minKubeVersion: 1.12.0
|
||||
provider:
|
||||
name: Mayadata
|
||||
name: ChaosNative
|
||||
labels:
|
||||
app.kubernetes.io/component: chartserviceversion
|
||||
app.kubernetes.io/version: latest
|
||||
|
@@ -50,7 +50,7 @@ func main() {
|
||||
|
||||
CRName, err := GetCRName(subdirectory + "/experiment.yaml")
|
||||
if err != nil || CRName == "" {
|
||||
log.Fatalf("unable to extract the CR name, err: %v", err)
|
||||
log.Fatalf("unable to extract the CR name for %v file, err: %v", subdirectory+"/experiment.yaml", err)
|
||||
}
|
||||
|
||||
if !Contains(CRName, CRNames) {
|
||||
|
Reference in New Issue
Block a user