charts(ansible): Add ansible chaos charts for running ansible experiments (#272)

Signed-off-by: Udit Gaurav <uditgaurav@gmail.com>

Co-authored-by: Karthik Satchitanand <karthik.s@mayadata.io>
This commit is contained in:
UDIT GAURAV
2020-07-21 13:16:28 +05:30
committed by GitHub
parent eb5a49065a
commit 6ebfd3057e
39 changed files with 1731 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: nginx-network-chaos
namespace: default
spec:
# It can be delete/retain
jobCleanUpPolicy: 'delete'
# It can be true/false
annotationCheck: 'true'
# It can be active/stop
engineState: 'active'
#ex. values: ns1:name=percona,ns2:run=nginx
auxiliaryAppInfo: ''
monitoring: false
appinfo:
appns: 'default'
# FYI, To see app label, apply kubectl get pods --show-labels
applabel: 'app=nginx'
appkind: 'deployment'
chaosServiceAccount: pod-network-corruption-sa
experiments:
- name: pod-network-corruption
spec:
components:
env:
#Container name where chaos has to be injected
- name: TARGET_CONTAINER
value: 'nginx'
#Network interface inside target container
- name: NETWORK_INTERFACE
value: 'eth0'
- name: TOTAL_CHAOS_DURATION
value: '60' # in seconds

View File

@@ -0,0 +1,66 @@
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Inject network packet corruption into application pod
kind: ChaosExperiment
metadata:
name: pod-network-corruption
version: 0.1.10
spec:
definition:
scope: Namespaced
permissions:
- apiGroups:
- ""
- "batch"
- "litmuschaos.io"
resources:
- "jobs"
- "pods"
- "pods/log"
- "events"
- "chaosengines"
- "chaosexperiments"
- "chaosresults"
verbs:
- "create"
- "delete"
- "list"
- "patch"
- "update"
- "get"
image: "litmuschaos/ansible-runner:1.6.0"
imagePullPolicy: Always
args:
- -c
- ansible-playbook ./experiments/generic/pod_network_corruption/pod_network_corruption_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
command:
- /bin/bash
env:
- name: ANSIBLE_STDOUT_CALLBACK
value: 'default'
- name: TARGET_CONTAINER
value: ''
# provide lib image
- name: LIB_IMAGE
value: 'gaiaadm/pumba:0.6.5'
- name: NETWORK_INTERFACE
value: 'eth0'
- name: NETWORK_PACKET_CORRUPTION_PERCENTAGE
value: '100' #in PERCENTAGE
- name: TOTAL_CHAOS_DURATION
value: '60' # in seconds
# Time period to wait before injection of chaos in sec
- name: RAMP_TIME
value: ''
- name: LIB
value: 'pumba'
labels:
name: pod-network-corruption

View File

@@ -0,0 +1,36 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-network-corruption-sa
namespace: default
labels:
name: pod-network-corruption-sa
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: pod-network-corruption-sa
namespace: default
labels:
name: pod-network-corruption-sa
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/v1beta1
kind: RoleBinding
metadata:
name: pod-network-corruption-sa
namespace: default
labels:
name: pod-network-corruption-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pod-network-corruption-sa
subjects:
- kind: ServiceAccount
name: pod-network-corruption-sa
namespace: default