diff --git a/charts/generic/generic.chartserviceversion.yaml b/charts/generic/generic.chartserviceversion.yaml index 34dd817..1e87b46 100644 --- a/charts/generic/generic.chartserviceversion.yaml +++ b/charts/generic/generic.chartserviceversion.yaml @@ -23,6 +23,7 @@ spec: - node-cpu-hog - disk-loss - disk-fill + - node-memory-hog keywords: - Kubernetes diff --git a/charts/generic/generic.package.yaml b/charts/generic/generic.package.yaml index 3d830f2..633de89 100644 --- a/charts/generic/generic.package.yaml +++ b/charts/generic/generic.package.yaml @@ -30,3 +30,6 @@ experiments: - name: pod-network-corruption CSV: pod-network-corruption.chartserviceversion.yaml desc: "pod-network-corruption" + - name: node-memory-hog + CSV: node-memory-hog.chartserviceversion.yaml + desc: "node-memory-hog" diff --git a/charts/generic/node-cpu-hog/experiment.yaml b/charts/generic/node-cpu-hog/experiment.yaml index 1b09ad3..b3a6039 100644 --- a/charts/generic/node-cpu-hog/experiment.yaml +++ b/charts/generic/node-cpu-hog/experiment.yaml @@ -19,7 +19,6 @@ spec: - "daemonsets" - "jobs" - "pods" - - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" diff --git a/charts/generic/node-cpu-hog/node-cpu-hog.chartserviceversion.yaml b/charts/generic/node-cpu-hog/node-cpu-hog.chartserviceversion.yaml index 2225922..9792870 100644 --- a/charts/generic/node-cpu-hog/node-cpu-hog.chartserviceversion.yaml +++ b/charts/generic/node-cpu-hog/node-cpu-hog.chartserviceversion.yaml @@ -11,14 +11,15 @@ metadata: spec: displayName: node-cpu-hog categoryDescription: | - Node 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. - + Node CPU hog contains chaos to disrupt the state of Kubernetes resources. Experiments can inject a CPU spike on a node where the application pod is scheduled. + - CPU hog on a particular node where the application deployment is available. + - After test, the recovery should be manual for the application pod and node in case they are not in an appropriate state. + keywords: - Kubernetes - CPU - - State + - State + - Node platforms: - GKE maturity: alpha diff --git a/charts/generic/node-cpu-hog/rbac.yaml b/charts/generic/node-cpu-hog/rbac.yaml index d5166aa..042ff1e 100644 --- a/charts/generic/node-cpu-hog/rbac.yaml +++ b/charts/generic/node-cpu-hog/rbac.yaml @@ -15,7 +15,7 @@ metadata: name: node-cpu-hog-sa rules: - apiGroups: ["","litmuschaos.io","batch","apps"] - resources: ["pods","daemonsets","jobs","pods/exec","events","chaosengines","chaosexperiments","chaosresults"] + resources: ["pods","jobs","events","chaosengines","chaosexperiments","chaosresults"] verbs: ["create","list","get","patch","update","delete"] - apiGroups: [""] resources: ["nodes"] diff --git a/charts/generic/node-memory-hog/engine.yaml b/charts/generic/node-memory-hog/engine.yaml new file mode 100644 index 0000000..8bc1c46 --- /dev/null +++ b/charts/generic/node-memory-hog/engine.yaml @@ -0,0 +1,38 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: nginx-chaos + namespace: default +spec: + # It can be true/false + annotationCheck: 'false' + # It can be active/stop + engineState: 'active' + #ex. values: ns1:name=percona,ns2:run=nginx + auxiliaryAppInfo: '' + appinfo: + appns: 'default' + applabel: 'app=nginx' + appkind: 'deployment' + chaosServiceAccount: node-memory-hog-sa + monitoring: false + # It can be delete/retain + jobCleanUpPolicy: 'delete' + experiments: + - name: node-memory-hog + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '60' + ## specify the size as percent of total available memory (in percentage %) + ## default value 90% + - name: MEMORY_PERCENTAGE + value: '90' + # set chaos platform as desired + - name: PLATFORM + value: 'GKE' + # chaos lib used to inject the chaos + - name: LIB + value: 'litmus' \ No newline at end of file diff --git a/charts/generic/node-memory-hog/experiment.yaml b/charts/generic/node-memory-hog/experiment.yaml new file mode 100644 index 0000000..009ab9b --- /dev/null +++ b/charts/generic/node-memory-hog/experiment.yaml @@ -0,0 +1,65 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + Give a memory hog on a node belonging to a deployment +kind: ChaosExperiment +metadata: + name: node-memory-hog + version: 0.1.0 +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/ansible-runner:latest" + args: + - -c + - ansible-playbook ./experiments/generic/node_memory_hog/node_memory_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' + + # Period to wait before injection of chaos in sec + - name: RAMP_TIME + value: '' + + - name: PLATFORM + value: 'GKE' + + - name: LIB + value: 'litmus' + + labels: + name: node-memory-hog \ No newline at end of file diff --git a/charts/generic/node-memory-hog/node-memory-hog.chartserviceversion.yaml b/charts/generic/node-memory-hog/node-memory-hog.chartserviceversion.yaml new file mode 100644 index 0000000..96a46e9 --- /dev/null +++ b/charts/generic/node-memory-hog/node-memory-hog.chartserviceversion.yaml @@ -0,0 +1,43 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2020-03-28T10:28:08Z + name: node-memory-hog + version: 0.1.0 + annotations: + categories: Kubernetes + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: node-memory-hog + categoryDescription: | + Kubernetes Node memory hog contains chaos to disrupt the state of Kubernetes resources. Experiments can inject 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. + + keywords: + - Kubernetes + - Memory + - State + - Node + platforms: + - GKE + maturity: alpha + chaosType: infra + maintainers: + - name: Udit Gaurav + email: udit.gaurav@mayadata.io + minKubeVersion: 1.12.0 + provider: + name: Mayadata + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus/tree/master/experiments/generic/node_memory_hog + - name: Documentation + url: https://docs.litmuschaos.io/docs/node-memory-hog/ + - name: Video + url: + icon: + - url: "" + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic/node-memory-hog/experiment.yaml diff --git a/charts/generic/node-memory-hog/rbac.yaml b/charts/generic/node-memory-hog/rbac.yaml new file mode 100644 index 0000000..9995ad8 --- /dev/null +++ b/charts/generic/node-memory-hog/rbac.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: node-memory-hog-sa + namespace: default + labels: + name: node-memory-hog-sa +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: node-memory-hog-sa + labels: + name: node-memory-hog-sa +rules: +- apiGroups: ["","litmuschaos.io","batch","apps"] + resources: ["pods","jobs","pods/log","events","chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +- apiGroups: [""] + resources: ["nodes"] + verbs : ["get","list"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: node-memory-hog-sa + labels: + name: node-memory-hog-sa +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: node-memory-hog-sa +subjects: +- kind: ServiceAccount + name: node-memory-hog-sa + namespace: default