refactors directory and file structure
Signed-off-by: neelanjan00 <neelanjan.manna@harness.io>
This commit is contained in:
154
experiments/pod-memory-hog/experiment.yaml
Normal file
154
experiments/pod-memory-hog/experiment.yaml
Normal file
@@ -0,0 +1,154 @@
|
||||
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: ''
|
||||
|
||||
- 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}}",
|
||||
]
|
158
experiments/pod-memory-hog/experiment_cron.yaml
Normal file
158
experiments/pod-memory-hog/experiment_cron.yaml
Normal file
@@ -0,0 +1,158 @@
|
||||
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: ''
|
||||
|
||||
- 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}}",
|
||||
]
|
@@ -0,0 +1,31 @@
|
||||
---
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
name: pod-memory-hog
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: pod-memory-hog
|
||||
chartDescription: Pod memory hog fault consumes memory resources of specified containers in Kubernetes pods.
|
||||
spec:
|
||||
displayName: Pod Memory Hog
|
||||
categoryDescription: >
|
||||
Pod memory hog fault consumes memory resources 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 tests 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.
|
||||
faults:
|
||||
- name: pod-memory-hog
|
||||
description: Pod memory hog fault consumes memory resources of specified containers in Kubernetes pods.
|
||||
keywords:
|
||||
- Kubernetes
|
||||
platforms:
|
||||
- GKE
|
||||
- Packet(Kubeadm)
|
||||
- Minikube
|
||||
- EKS
|
||||
- AKS
|
||||
- OpenShift(OKD)
|
||||
icon:
|
||||
- url:
|
||||
mediatype: ""
|
Reference in New Issue
Block a user