feat[chart]: Add chaos-charts for CPU-Hog experiment (#36)

* (refactor): Modification in cpu-hog experiment CR

Signed-off-by: Udit Gaurav <uditgaurav@gmail.com>
This commit is contained in:
UDIT GAURAV
2019-11-11 20:02:48 +05:30
committed by Chandan Kumar
parent 85d7f1f0db
commit b33fa5a56e
2 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
apiVersion: litmuchaos.io/v1alpha1
kind: ChartServiceVersion
metadata:
name: cpu-hog
version: 0.0.1
annotations:
categories: Kubernetes
vendor: CNCF
createdAt: 2019-08-12T10:28:08Z
repository: https://github.com/litmuschaos/chaos-charts
support: https://slack.kubernetes.io/
spec:
displayName: cpu-hog
categoryDescription: |
CPU hog contains chaos to disrupt state of kubernetes resources. Experiments can inject a cpu skipe on a node where the application pod is scheduled.
- Causes (forced/graceful) cpu hog on a perticular node where the application deployment is available.
- After test the recovery should be manual of the application pod and node in case they are not in appropriate state.
keywords:
- Kubernetes
- CPU
- State
platforms:
- GKE
maturity: alpha
maintainers:
- name: ksatchit
email: karthik.s@mayadata.io
minKubeVersion: 1.12.0
provider:
name: Mayadata
links:
- name: Kubernetes Website
url: https://kubernetes.io
- name: Source Code
url: https://github.com/kubernetes/kubernetes
icon:
- url:
mediatype: ""
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/cpu-hog/experiment.yaml

View File

@@ -0,0 +1,52 @@
apiVersion: litmuschaos.io/v1alpha1
description:
message: |
Give a cpu spike on a node belonging to a deployment
kind: ChaosExperiment
metadata:
name: cpu-hog
version: 0.0.1
spec:
definition:
permissions:
apiGroups:
- ""
- "extensions"
- "apps"
- "batch"
- "litmuschaos.io"
resources:
- "daemonsets"
- "statefulsets"
- "deployments"
- "jobs"
- "nodes"
- "pods"
- "pods/exec"
- "chaosengines"
- "chaosexperiments"
- "chaosresults"
verbs:
- "*"
image: "litmuschaos/ansible-runner:ci"
args:
- -c
- ansible-playbook ./experiments/generic/cpu_hog/cpu_hog_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
command:
- /bin/bash
env:
- name: ANSIBLE_STDOUT_CALLBACK
value: 'default'
- name: TOTAL_CHAOS_DURATION
value: '60'
- name: PLATFORM
value: 'ANY'
- name: LIB
value: ''
labels:
name: cpu-hog