refactors directory and file structure
Signed-off-by: neelanjan00 <neelanjan.manna@harness.io>
This commit is contained in:
161
experiments/pod-delete/experiment_cron.yaml
Normal file
161
experiments/pod-delete/experiment_cron.yaml
Normal file
@@ -0,0 +1,161 @@
|
||||
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'
|
||||
|
||||
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}}",
|
||||
]
|
Reference in New Issue
Block a user