refactors directory and file structure
Signed-off-by: neelanjan00 <neelanjan.manna@harness.io>
This commit is contained in:
149
experiments/node-memory-hog/experiment.yaml
Normal file
149
experiments/node-memory-hog/experiment.yaml
Normal file
@@ -0,0 +1,149 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: argowf-chaos-node-memory-hog-
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.context}}"
|
||||
spec:
|
||||
entrypoint: argowf-chaos
|
||||
serviceAccountName: argo-chaos
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsNonRoot: true
|
||||
arguments:
|
||||
parameters:
|
||||
- name: adminModeNamespace
|
||||
value: "litmus"
|
||||
- name: context
|
||||
value: "node-memory-hog_infra"
|
||||
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/node-memory-hog.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Give a memory hog on a node belonging to a deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: node-memory-hog
|
||||
spec:
|
||||
definition:
|
||||
scope: Cluster
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "batch"
|
||||
- "apps"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "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 node-memory-hog
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '120'
|
||||
|
||||
## specify the size as percent of total available memory (in percentage)
|
||||
## Default value "90"
|
||||
- name: MEMORY_PERCENTAGE
|
||||
value: '90'
|
||||
|
||||
# Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
|
||||
# provide lib image
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/go-runner:latest'
|
||||
|
||||
labels:
|
||||
name: node-memory-hog
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl apply -f /tmp/node-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-node-memory-hog-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.context}}"
|
||||
spec:
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
experiments:
|
||||
- name: node-memory-hog
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
- name: MEMORY_PERCENTAGE
|
||||
value: '50'
|
||||
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
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-node-memory-hog-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
144
experiments/node-memory-hog/experiment_cron.yaml
Normal file
144
experiments/node-memory-hog/experiment_cron.yaml
Normal file
@@ -0,0 +1,144 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: CronWorkflow
|
||||
metadata:
|
||||
name: argo-chaos-node-memory-cron-wf
|
||||
namespace: litmus
|
||||
labels:
|
||||
subject: "{{workflow.parameters.context}}"
|
||||
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: context
|
||||
value: "node-memory-hog_infra"
|
||||
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/node-memory-hog.yaml
|
||||
raw:
|
||||
data: |
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
description:
|
||||
message: |
|
||||
Give a memory hog on a node belonging to a deployment
|
||||
kind: ChaosExperiment
|
||||
metadata:
|
||||
name: node-memory-hog
|
||||
spec:
|
||||
definition:
|
||||
scope: Cluster
|
||||
permissions:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "batch"
|
||||
- "apps"
|
||||
- "litmuschaos.io"
|
||||
resources:
|
||||
- "jobs"
|
||||
- "pods"
|
||||
- "pods/log"
|
||||
- "events"
|
||||
- "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 node-memory-hog
|
||||
command:
|
||||
- /bin/bash
|
||||
env:
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '120'
|
||||
## specify the size as percent of total available memory (in percentage)
|
||||
## Default value "90"
|
||||
- name: MEMORY_PERCENTAGE
|
||||
value: '90'
|
||||
# Period to wait before and after injection of chaos in sec
|
||||
- name: RAMP_TIME
|
||||
value: ''
|
||||
# provide lib image
|
||||
- name: LIB_IMAGE
|
||||
value: 'litmuschaos/go-runner:latest'
|
||||
labels:
|
||||
name: node-memory-hog
|
||||
container:
|
||||
image: litmuschaos/k8s:latest
|
||||
command: [sh, -c]
|
||||
args:
|
||||
[
|
||||
"kubectl apply -f /tmp/node-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-node-memory-hog-chaos
|
||||
namespace: {{workflow.parameters.adminModeNamespace}}
|
||||
labels:
|
||||
context: "{{workflow.parameters.context}}"
|
||||
spec:
|
||||
jobCleanUpPolicy: retain
|
||||
engineState: 'active'
|
||||
chaosServiceAccount: litmus-admin
|
||||
experiments:
|
||||
- name: node-memory-hog
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
- name: MEMORY_PERCENTAGE
|
||||
value: '50'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60' # in seconds
|
||||
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-node-memory-hog-chaos -n {{workflow.parameters.adminModeNamespace}}",
|
||||
]
|
@@ -0,0 +1,30 @@
|
||||
---
|
||||
apiVersion: litmuschaos.io/v1alpha1
|
||||
kind: ChartServiceVersion
|
||||
metadata:
|
||||
name: node-memory-hog
|
||||
version: 0.1.0
|
||||
annotations:
|
||||
categories: node-memory-hog
|
||||
chartDescription: Node memory hog injects a memory spike on a node where the application pod is scheduled.
|
||||
spec:
|
||||
displayName: Node Memory Hog
|
||||
categoryDescription: >
|
||||
Node memory hog fault disrupts the state of Kubernetes resources. This fault injects a memory spike on a node where the application pod is scheduled.
|
||||
- Memory hog on a particular node where the application deployment is available.
|
||||
- After the test, the recovery should be manual for the application pod and node in case they are not in an appropriate state.
|
||||
faults:
|
||||
- name: node-memory-hog
|
||||
description: Node memory hog injects a memory spike on a node where the application pod is scheduled.
|
||||
keywords:
|
||||
- Kubernetes
|
||||
platforms:
|
||||
- GKE
|
||||
- EKS
|
||||
- AKS
|
||||
- Kind
|
||||
- Rancher
|
||||
- OpenShift(OKD)
|
||||
icon:
|
||||
- url:
|
||||
mediatype: ""
|
Reference in New Issue
Block a user