diff --git a/charts/generic/generic.chartserviceversion.yaml b/charts/generic/generic.chartserviceversion.yaml index 9015b27..ac6ab93 100644 --- a/charts/generic/generic.chartserviceversion.yaml +++ b/charts/generic/generic.chartserviceversion.yaml @@ -32,6 +32,7 @@ spec: - pod-autoscaler - k8-pod-delete - k8-service-kill + - node-io-stress keywords: - Kubernetes @@ -39,6 +40,8 @@ spec: - Node - Pod - Disk + - IO + - Filesystem - Network - CPU - Memory diff --git a/charts/generic/generic.package.yaml b/charts/generic/generic.package.yaml index 8a411b7..66f105a 100644 --- a/charts/generic/generic.package.yaml +++ b/charts/generic/generic.package.yaml @@ -57,3 +57,6 @@ experiments: - name: k8-service-kill CSV: k8-service-kill.chartserviceversion.yaml desc: "k8-service-kill" + - name: node-io-stress + CSV: node-io-stress.chartserviceversion.yaml + desc: "node-io-stress" diff --git a/charts/generic/icons/node-io-stress.png b/charts/generic/icons/node-io-stress.png new file mode 100644 index 0000000..5d13f6b Binary files /dev/null and b/charts/generic/icons/node-io-stress.png differ diff --git a/charts/generic/node-io-stress/engine.yaml b/charts/generic/node-io-stress/engine.yaml new file mode 100644 index 0000000..e7719e9 --- /dev/null +++ b/charts/generic/node-io-stress/engine.yaml @@ -0,0 +1,36 @@ +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-io-stress-sa + monitoring: false + # It can be delete/retain + jobCleanUpPolicy: 'delete' + experiments: + - name: node-io-stress + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '120' + + ## specify the size as percentage of free space on the file system + - name: FILESSYSTEM_UTILIZATION_PERCENTAGE + value: '10' + + ## enter the name of the desired node + - name: APP_NODE + value: '' diff --git a/charts/generic/node-io-stress/experiment.yaml b/charts/generic/node-io-stress/experiment.yaml new file mode 100644 index 0000000..d2cc33a --- /dev/null +++ b/charts/generic/node-io-stress/experiment.yaml @@ -0,0 +1,83 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + Give a memory hog on a node belonging to a deployment +kind: ChaosExperiment +metadata: + name: node-io-stress +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/node-io-stress + command: + - /bin/bash + env: + + - name: TOTAL_CHAOS_DURATION + value: '120' + + ## specify the size as percentage of free space on the file system + ## default value 90 (in percentage) + - name: FILESSYSTEM_UTILIZATION_PERCENTAGE + value: '10' + + ## we can specify the size in Gigabyte (Gb) also in place of percentage of free space + ## NOTE: for selecting this option FILESSYSTEM_UTILIZATION_PERCENTAGE should be empty + - name: FILESSYSTEM_UTILIZATION_BYTES + value: '' + + ## Total number of workers default value is 4 + - name: NUMBER_OF_WORKERS + value: '4' + + ## enter the name of the desired node + - name: APP_NODE + value: '' + + # Period to wait before and after injection of chaos in sec + - name: RAMP_TIME + value: '' + + # Provide the LIB here + # Only litmus supported + - name: LIB + value: 'litmus' + + # provide lib image + - name: LIB_IMAGE + value: 'litmuschaos/go-runner:latest' + + labels: + name: node-io-stress diff --git a/charts/generic/node-io-stress/node-io-stress.chartserviceversion.yaml b/charts/generic/node-io-stress/node-io-stress.chartserviceversion.yaml new file mode 100644 index 0000000..4ac63d9 --- /dev/null +++ b/charts/generic/node-io-stress/node-io-stress.chartserviceversion.yaml @@ -0,0 +1,46 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2020-09-12T10:28:08Z + name: + version: 0.1.0 + annotations: + categories: Kubernetes + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: + categoryDescription: | + This experiment causes disk stress on the Kubernetes node. The experiment aims to verify the resiliency of applications that share this disk resource for ephemeral or persistent storage purposes.. + - Disk stress on a particular node filesystem where the application deployment is available. + - The amount of disk stress can be either specifed as the size in percentage of the total free space on the file system or simply in Gigabytes(Gb) + - 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 + - Disk + - IO + - Filesystem + - State + - Node + platforms: + - GKE + - EKS + 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-go/tree/master/experiments/generic/ + - name: Documentation + url: https://docs.litmuschaos.io/docs// + - name: Video + url: + icon: + - url: "" + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/generic//experiment.yaml diff --git a/charts/generic/node-io-stress/rbac.yaml b/charts/generic/node-io-stress/rbac.yaml new file mode 100644 index 0000000..5835020 --- /dev/null +++ b/charts/generic/node-io-stress/rbac.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: node-io-stress-sa + namespace: default + labels: + name: node-io-stress-sa +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: node-io-stress-sa + labels: + name: node-io-stress-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-io-stress-sa + labels: + name: node-io-stress-sa +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: node-io-stress-sa +subjects: +- kind: ServiceAccount + name: node-io-stress-sa + namespace: default