diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..d8cf12c00 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + \ No newline at end of file diff --git a/charts/spring-boot/icons/spring-boot-app-kill.png b/charts/spring-boot/icons/spring-boot-app-kill.png new file mode 100644 index 000000000..fa8728f1a Binary files /dev/null and b/charts/spring-boot/icons/spring-boot-app-kill.png differ diff --git a/charts/spring-boot/icons/spring-boot-cpu-stress.png b/charts/spring-boot/icons/spring-boot-cpu-stress.png new file mode 100644 index 000000000..fa8728f1a Binary files /dev/null and b/charts/spring-boot/icons/spring-boot-cpu-stress.png differ diff --git a/charts/spring-boot/icons/spring-boot-exceptions.png b/charts/spring-boot/icons/spring-boot-exceptions.png new file mode 100644 index 000000000..fa8728f1a Binary files /dev/null and b/charts/spring-boot/icons/spring-boot-exceptions.png differ diff --git a/charts/spring-boot/icons/spring-boot-latency.png b/charts/spring-boot/icons/spring-boot-latency.png new file mode 100644 index 000000000..fa8728f1a Binary files /dev/null and b/charts/spring-boot/icons/spring-boot-latency.png differ diff --git a/charts/spring-boot/icons/spring-boot-memory-stress.png b/charts/spring-boot/icons/spring-boot-memory-stress.png new file mode 100644 index 000000000..fa8728f1a Binary files /dev/null and b/charts/spring-boot/icons/spring-boot-memory-stress.png differ diff --git a/charts/spring-boot/icons/spring-boot.png b/charts/spring-boot/icons/spring-boot.png new file mode 100644 index 000000000..fa8728f1a Binary files /dev/null and b/charts/spring-boot/icons/spring-boot.png differ diff --git a/charts/spring-boot/spring-boot-app-kill/engine.yaml b/charts/spring-boot/spring-boot-app-kill/engine.yaml new file mode 100644 index 000000000..9fd90d657 --- /dev/null +++ b/charts/spring-boot/spring-boot-app-kill/engine.yaml @@ -0,0 +1,30 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: spring-boot-chaos + namespace: default +spec: + appinfo: + appns: 'default' + applabel: 'app=spring-boot' + appkind: 'deployment' + # It can be active/stop + engineState: 'active' + chaosServiceAccount: spring-boot-app-kill-sa + experiments: + - name: spring-boot-app-kill + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '30' + + # Cron expression like */1 * * * * ? can be set to enable chaos monkey AppKiller assault on a schedule + - name: CM_KILL_APPLICATION_CRON + value: '*/1 * * * * ?' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + \ No newline at end of file diff --git a/charts/spring-boot/spring-boot-app-kill/experiment.yaml b/charts/spring-boot/spring-boot-app-kill/experiment.yaml new file mode 100644 index 000000000..1cc0b2bb7 --- /dev/null +++ b/charts/spring-boot/spring-boot-app-kill/experiment.yaml @@ -0,0 +1,84 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + It can target random pods with a Spring Boot application and allows configuring the assaults to inject app-kill +kind: ChaosExperiment +metadata: + name: spring-boot-app-kill + labels: + name: spring-boot-app-kill + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [ "" ] + resources: [ "pods" ] + verbs: [ "create","delete","get","list","patch","update", "deletecollection" ] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [ "" ] + resources: [ "events" ] + verbs: [ "create","get","list","patch","update" ] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [ "" ] + resources: [ "pods/log" ] + verbs: [ "get","list","watch" ] + # for creating and managing to execute commands inside target container + - apiGroups: [ "" ] + resources: [ "pods/exec" ] + verbs: [ "get","list","create" ] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: [ "batch" ] + resources: [ "jobs" ] + verbs: [ "create","list","get","delete","deletecollection" ] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: [ "litmuschaos.io" ] + resources: [ "chaosengines","chaosexperiments","chaosresults" ] + verbs: [ "create","list","get","patch","update","delete" ] + image: "litmuschaos/go-runner:latest" + imagePullPolicy: Always + args: + - -c + - ./experiments -name spring-boot-app-kill + command: + - /bin/bash + env: + + # Cron expression like */1 * * * * ? can be set to enable chaos monkey AppKiller assault on a schedule + - name: CM_KILL_APPLICATION_CRON + value: '' + + # provide name of watcher + # it supports controller, restController, service, repository, component, webClient + - name: CM_WATCHERS + value: 'restController' + + - name: TOTAL_CHAOS_DURATION + value: '30' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + ## Period to wait before and after injection of chaos + - name: RAMP_TIME + value: '' + + ## it defines the sequence of chaos execution for multiple target pods + ## supported values: serial, parallel + - name: SEQUENCE + value: 'parallel' + + ## env var that describes the library used to execute the chaos + ## default: litmus. Supported values: litmus + - name: LIB + value: 'litmus' + + labels: + name: spring-boot-app-kill + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest diff --git a/charts/spring-boot/spring-boot-app-kill/rbac.yaml b/charts/spring-boot/spring-boot-app-kill/rbac.yaml new file mode 100644 index 000000000..991ef22c3 --- /dev/null +++ b/charts/spring-boot/spring-boot-app-kill/rbac.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: spring-boot-app-kill-sa + namespace: default + labels: + name: spring-boot-app-kill-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: spring-boot-app-kill-sa + namespace: default + labels: + name: spring-boot-app-kill-sa + app.kubernetes.io/part-of: litmus +rules: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute commands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: spring-boot-app-kill-sa + namespace: default + labels: + name: spring-boot-app-kill-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: spring-boot-app-kill-sa +subjects: +- kind: ServiceAccount + name: spring-boot-app-kill-sa + namespace: default + diff --git a/charts/spring-boot/spring-boot-app-kill/spring-boot-app-kill.chartserviceversion.yaml b/charts/spring-boot/spring-boot-app-kill/spring-boot-app-kill.chartserviceversion.yaml new file mode 100644 index 000000000..184c5302c --- /dev/null +++ b/charts/spring-boot/spring-boot-app-kill/spring-boot-app-kill.chartserviceversion.yaml @@ -0,0 +1,49 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2022-11-17T10:28:08Z + name: spring-boot-app-kill + version: 0.1.0 + annotations: + categories: Spring Boot + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: spring-boot-app-kill + categoryDescription: | + This experiment allows injecting Chaos Monkey app-kill assaults on Spring Boot applications, which have the [Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/) in their classpath. + It can target random pods with a Spring Boot application and allows configuring the assaults to inject app-kill. It tests the resiliency of the system when some applications are having unexpected faulty behavior. + keywords: + - Kubernetes + - K8S + - Spring Boot + - Pod + platforms: + - GKE + - Konvoy + - Packet(Kubeadm) + - Minikube + - EKS + maturity: alpha + maintainers: + - name: Stephane Cazeaux + email: stephane.cazeaux@orange.com + - name: Shubham Chaudhary + email: shubham.chaudhary@harness.io + minKubeVersion: 1.12.0 + provider: + name: Orange + labels: + app.kubernetes.io/component: chartserviceversion + app.kubernetes.io/version: latest + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/spring-boot/spring-boot-app-kill + - name: Documentation + url: https://litmuschaos.github.io/litmus/experiments/categories/spring-boot/spring-boot-app-kill + - name: Video + url: + icon: + - url: + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot-app-kill/experiment.yaml diff --git a/charts/spring-boot/spring-boot-cpu-stress/engine.yaml b/charts/spring-boot/spring-boot-cpu-stress/engine.yaml new file mode 100644 index 000000000..594917987 --- /dev/null +++ b/charts/spring-boot/spring-boot-cpu-stress/engine.yaml @@ -0,0 +1,34 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: spring-boot-chaos + namespace: default +spec: + appinfo: + appns: 'default' + applabel: 'app=spring-boot' + appkind: 'deployment' + # It can be active/stop + engineState: 'active' + chaosServiceAccount: spring-boot-cpu-stress-sa + experiments: + - name: spring-boot-cpu-stress + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '30' + + # Cron expression like */1 * * * * ? can be set to enable cpu assault on a schedule + - name: CM_CPU_CRON + value: '*/1 * * * * ?' + + # Final fraction of used cpu by assault. 0.95 equals 95 %. + - name: CM_CPU_LOAD_TARGET_FRACTION + value: '0.8' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + \ No newline at end of file diff --git a/charts/spring-boot/spring-boot-cpu-stress/experiment.yaml b/charts/spring-boot/spring-boot-cpu-stress/experiment.yaml new file mode 100644 index 000000000..f6a46fb03 --- /dev/null +++ b/charts/spring-boot/spring-boot-cpu-stress/experiment.yaml @@ -0,0 +1,92 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + It can target random pods with a Spring Boot application and allows configuring the assaults to inject cpu-stress +kind: ChaosExperiment +metadata: + name: spring-boot-cpu-stress + labels: + name: spring-boot-cpu-stress + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [ "" ] + resources: [ "pods" ] + verbs: [ "create","delete","get","list","patch","update", "deletecollection" ] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [ "" ] + resources: [ "events" ] + verbs: [ "create","get","list","patch","update" ] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [ "" ] + resources: [ "pods/log" ] + verbs: [ "get","list","watch" ] + # for creating and managing to execute commands inside target container + - apiGroups: [ "" ] + resources: [ "pods/exec" ] + verbs: [ "get","list","create" ] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: [ "batch" ] + resources: [ "jobs" ] + verbs: [ "create","list","get","delete","deletecollection" ] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: [ "litmuschaos.io" ] + resources: [ "chaosengines","chaosexperiments","chaosresults" ] + verbs: [ "create","list","get","patch","update","delete" ] + image: "litmuschaos/go-runner:latest" + imagePullPolicy: Always + args: + - -c + - ./experiments -name spring-boot-cpu-stress + command: + - /bin/bash + env: + + # Cron expression like */1 * * * * ? can be set to enable cpu assault on a schedule + - name: CM_CPU_CRON + value: '' + + # Duration to assault cpu when requested load is reached in ms. + - name: CM_CPU_MS_HOLD_LOAD + value: '15000' + + # Final fraction of used cpu by assault. 0.95 equals 95 %. + - name: CM_CPU_LOAD_TARGET_FRACTION + value: '0.95' + + # provide name of watcher + # it supports controller, restController, service, repository, component, webClient + - name: CM_WATCHERS + value: 'restController' + + - name: TOTAL_CHAOS_DURATION + value: '30' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + ## Period to wait before and after injection of chaos + - name: RAMP_TIME + value: '' + + ## it defines the sequence of chaos execution for multiple target pods + ## supported values: serial, parallel + - name: SEQUENCE + value: 'parallel' + + ## env var that describes the library used to execute the chaos + ## default: litmus. Supported values: litmus + - name: LIB + value: 'litmus' + + labels: + name: spring-boot-cpu-stress + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest diff --git a/charts/spring-boot/spring-boot-cpu-stress/rbac.yaml b/charts/spring-boot/spring-boot-cpu-stress/rbac.yaml new file mode 100644 index 000000000..812ec5b0c --- /dev/null +++ b/charts/spring-boot/spring-boot-cpu-stress/rbac.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: spring-boot-cpu-stress-sa + namespace: default + labels: + name: spring-boot-cpu-stress-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: spring-boot-cpu-stress-sa + namespace: default + labels: + name: spring-boot-cpu-stress-sa + app.kubernetes.io/part-of: litmus +rules: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute commands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: spring-boot-cpu-stress-sa + namespace: default + labels: + name: spring-boot-cpu-stress-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: spring-boot-cpu-stress-sa +subjects: +- kind: ServiceAccount + name: spring-boot-cpu-stress-sa + namespace: default + diff --git a/charts/spring-boot/spring-boot-cpu-stress/spring-boot-cpu-stress.chartserviceversion.yaml b/charts/spring-boot/spring-boot-cpu-stress/spring-boot-cpu-stress.chartserviceversion.yaml new file mode 100644 index 000000000..a040b370e --- /dev/null +++ b/charts/spring-boot/spring-boot-cpu-stress/spring-boot-cpu-stress.chartserviceversion.yaml @@ -0,0 +1,49 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2022-11-17T10:28:08Z + name: spring-boot-cpu-stress + version: 0.1.0 + annotations: + categories: Spring Boot + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: spring-boot-cpu-stress + categoryDescription: | + This experiment allows injecting Chaos Monkey cpu stress assaults on Spring Boot applications, which have the [Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/) in their classpath. + It can target random pods with a Spring Boot application and allows configuring the assaults to inject CPU stress. It tests the resiliency of the system when some applications are having unexpected faulty behavior. + keywords: + - Kubernetes + - K8S + - Spring Boot + - Pod + platforms: + - GKE + - Konvoy + - Packet(Kubeadm) + - Minikube + - EKS + maturity: alpha + maintainers: + - name: Stephane Cazeaux + email: stephane.cazeaux@orange.com + - name: Shubham Chaudhary + email: shubham.chaudhary@harness.io + minKubeVersion: 1.12.0 + provider: + name: Orange + labels: + app.kubernetes.io/component: chartserviceversion + app.kubernetes.io/version: latest + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/spring-boot/spring-boot-cpu-stress + - name: Documentation + url: https://litmuschaos.github.io/litmus/experiments/categories/spring-boot/spring-boot-cpu-stress + - name: Video + url: + icon: + - url: + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot-cpu-stress/experiment.yaml diff --git a/charts/spring-boot/spring-boot-exceptions/engine.yaml b/charts/spring-boot/spring-boot-exceptions/engine.yaml new file mode 100644 index 000000000..d75a7cefd --- /dev/null +++ b/charts/spring-boot/spring-boot-exceptions/engine.yaml @@ -0,0 +1,34 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: spring-boot-chaos + namespace: default +spec: + appinfo: + appns: 'default' + applabel: 'app=spring-boot' + appkind: 'deployment' + # It can be active/stop + engineState: 'active' + chaosServiceAccount: spring-boot-exceptions-sa + experiments: + - name: spring-boot-exceptions + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '30' + + # Type of raised exception + - name: CM_EXCEPTIONS_TYPE + value: 'java.lang.IllegalArgumentException' + + # Argument of raised exception + - name: CM_EXCEPTIONS_ARGUMENTS + value: 'java.lang.String:custom illegal argument exception' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + \ No newline at end of file diff --git a/charts/spring-boot/spring-boot-exceptions/experiment.yaml b/charts/spring-boot/spring-boot-exceptions/experiment.yaml new file mode 100644 index 000000000..9e51d7667 --- /dev/null +++ b/charts/spring-boot/spring-boot-exceptions/experiment.yaml @@ -0,0 +1,88 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + It can target random pods with a Spring Boot application and allows configuring the assaults to inject network latency +kind: ChaosExperiment +metadata: + name: spring-boot-exceptions + labels: + name: spring-boot-exceptions + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [ "" ] + resources: [ "pods" ] + verbs: [ "create","delete","get","list","patch","update", "deletecollection" ] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [ "" ] + resources: [ "events" ] + verbs: [ "create","get","list","patch","update" ] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [ "" ] + resources: [ "pods/log" ] + verbs: [ "get","list","watch" ] + # for creating and managing to execute commands inside target container + - apiGroups: [ "" ] + resources: [ "pods/exec" ] + verbs: [ "get","list","create" ] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: [ "batch" ] + resources: [ "jobs" ] + verbs: [ "create","list","get","delete","deletecollection" ] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: [ "litmuschaos.io" ] + resources: [ "chaosengines","chaosexperiments","chaosresults" ] + verbs: [ "create","list","get","patch","update","delete" ] + image: "litmuschaos/go-runner:latest" + imagePullPolicy: Always + args: + - -c + - ./experiments -name spring-boot-exceptions + command: + - /bin/bash + env: + + # Type of raised exception + - name: CM_EXCEPTIONS_TYPE + value: 'java.lang.IllegalArgumentException' + + # Argument of raised exception + - name: CM_EXCEPTIONS_ARGUMENTS + value: 'java.lang.String:custom illegal argument exception' + + # provide name of watcher + # it supports controller, restController, service, repository, component, webClient + - name: CM_WATCHERS + value: 'restController' + + - name: TOTAL_CHAOS_DURATION + value: '30' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + ## Period to wait before and after injection of chaos + - name: RAMP_TIME + value: '' + + ## it defines the sequence of chaos execution for multiple target pods + ## supported values: serial, parallel + - name: SEQUENCE + value: 'parallel' + + ## env var that describes the library used to execute the chaos + ## default: litmus. Supported values: litmus + - name: LIB + value: 'litmus' + + labels: + name: spring-boot-exceptions + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest diff --git a/charts/spring-boot/spring-boot-exceptions/rbac.yaml b/charts/spring-boot/spring-boot-exceptions/rbac.yaml new file mode 100644 index 000000000..6ef38bad2 --- /dev/null +++ b/charts/spring-boot/spring-boot-exceptions/rbac.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: spring-boot-exceptions-sa + namespace: default + labels: + name: spring-boot-exceptions-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: spring-boot-exceptions-sa + namespace: default + labels: + name: spring-boot-exceptions-sa + app.kubernetes.io/part-of: litmus +rules: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute commands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: spring-boot-exceptions-sa + namespace: default + labels: + name: spring-boot-exceptions-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: spring-boot-exceptions-sa +subjects: +- kind: ServiceAccount + name: spring-boot-exceptions-sa + namespace: default + diff --git a/charts/spring-boot/spring-boot-exceptions/spring-boot-exceptions.chartserviceversion.yaml b/charts/spring-boot/spring-boot-exceptions/spring-boot-exceptions.chartserviceversion.yaml new file mode 100644 index 000000000..ac9e8ee24 --- /dev/null +++ b/charts/spring-boot/spring-boot-exceptions/spring-boot-exceptions.chartserviceversion.yaml @@ -0,0 +1,49 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2022-11-17T10:28:08Z + name: spring-boot-exceptions + version: 0.1.0 + annotations: + categories: Spring Boot + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: spring-boot-exceptions + categoryDescription: | + This experiment allows injecting Chaos Monkey exceptions assaults on Spring Boot applications, which have the [Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/) in their classpath. + It can target random pods with a Spring Boot application and allows configuring the assaults to inject exception. It tests the resiliency of the system when some applications are having unexpected faulty behavior. + keywords: + - Kubernetes + - K8S + - Spring Boot + - Pod + platforms: + - GKE + - Konvoy + - Packet(Kubeadm) + - Minikube + - EKS + maturity: alpha + maintainers: + - name: Stephane Cazeaux + email: stephane.cazeaux@orange.com + - name: Shubham Chaudhary + email: shubham.chaudhary@harness.io + minKubeVersion: 1.12.0 + provider: + name: Orange + labels: + app.kubernetes.io/component: chartserviceversion + app.kubernetes.io/version: latest + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/spring-boot/spring-boot-exceptions + - name: Documentation + url: https://litmuschaos.github.io/litmus/experiments/categories/spring-boot/spring-boot-exceptions + - name: Video + url: + icon: + - url: + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot-exceptions/experiment.yaml diff --git a/charts/spring-boot/spring-boot-latency/engine.yaml b/charts/spring-boot/spring-boot-latency/engine.yaml new file mode 100644 index 000000000..9647a20b1 --- /dev/null +++ b/charts/spring-boot/spring-boot-latency/engine.yaml @@ -0,0 +1,34 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: spring-boot-chaos + namespace: default +spec: + appinfo: + appns: 'default' + applabel: 'app=spring-boot' + appkind: 'deployment' + # It can be active/stop + engineState: 'active' + chaosServiceAccount: spring-boot-latency-sa + experiments: + - name: spring-boot-latency + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '30' + + # Minimum latency (ms) + - name: CM_LATENCY_RANGE_START + value: '2000' + + # Maximum latency (ms) + - name: CM_LATENCY_RANGE_END + value: '5000' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + \ No newline at end of file diff --git a/charts/spring-boot/spring-boot-latency/experiment.yaml b/charts/spring-boot/spring-boot-latency/experiment.yaml new file mode 100644 index 000000000..d3c031c0c --- /dev/null +++ b/charts/spring-boot/spring-boot-latency/experiment.yaml @@ -0,0 +1,88 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + It can target random pods with a Spring Boot application and allows configuring the assaults to inject network latency +kind: ChaosExperiment +metadata: + name: spring-boot-latency + labels: + name: spring-boot-latency + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [ "" ] + resources: [ "pods" ] + verbs: [ "create","delete","get","list","patch","update", "deletecollection" ] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [ "" ] + resources: [ "events" ] + verbs: [ "create","get","list","patch","update" ] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [ "" ] + resources: [ "pods/log" ] + verbs: [ "get","list","watch" ] + # for creating and managing to execute commands inside target container + - apiGroups: [ "" ] + resources: [ "pods/exec" ] + verbs: [ "get","list","create" ] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: [ "batch" ] + resources: [ "jobs" ] + verbs: [ "create","list","get","delete","deletecollection" ] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: [ "litmuschaos.io" ] + resources: [ "chaosengines","chaosexperiments","chaosresults" ] + verbs: [ "create","list","get","patch","update","delete" ] + image: "litmuschaos/go-runner:latest" + imagePullPolicy: Always + args: + - -c + - ./experiments -name spring-boot-latency + command: + - /bin/bash + env: + + # Minimum latency (ms) + - name: CM_LATENCY_RANGE_START + value: '2000' + + # Maximum latency (ms) + - name: CM_LATENCY_RANGE_END + value: '5000' + + # provide name of watcher + # it supports controller, restController, service, repository, component, webClient + - name: CM_WATCHERS + value: 'restController' + + - name: TOTAL_CHAOS_DURATION + value: '30' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + ## Period to wait before and after injection of chaos + - name: RAMP_TIME + value: '' + + ## it defines the sequence of chaos execution for multiple target pods + ## supported values: serial, parallel + - name: SEQUENCE + value: 'parallel' + + ## env var that describes the library used to execute the chaos + ## default: litmus. Supported values: litmus + - name: LIB + value: 'litmus' + + labels: + name: spring-boot-latency + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest diff --git a/charts/spring-boot/spring-boot-latency/rbac.yaml b/charts/spring-boot/spring-boot-latency/rbac.yaml new file mode 100644 index 000000000..91b9639db --- /dev/null +++ b/charts/spring-boot/spring-boot-latency/rbac.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: spring-boot-latency-sa + namespace: default + labels: + name: spring-boot-latency-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: spring-boot-latency-sa + namespace: default + labels: + name: spring-boot-latency-sa + app.kubernetes.io/part-of: litmus +rules: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute commands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: spring-boot-latency-sa + namespace: default + labels: + name: spring-boot-latency-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: spring-boot-latency-sa +subjects: +- kind: ServiceAccount + name: spring-boot-latency-sa + namespace: default + diff --git a/charts/spring-boot/spring-boot-latency/spring-boot-latency.chartserviceversion.yaml b/charts/spring-boot/spring-boot-latency/spring-boot-latency.chartserviceversion.yaml new file mode 100644 index 000000000..f8553bded --- /dev/null +++ b/charts/spring-boot/spring-boot-latency/spring-boot-latency.chartserviceversion.yaml @@ -0,0 +1,49 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2022-11-17T10:28:08Z + name: spring-boot-latency + version: 0.1.0 + annotations: + categories: Spring Boot + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: spring-boot-latency + categoryDescription: | + This experiment allows injecting Chaos Monkey network latency assaults on Spring Boot applications, which have the [Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/) in their classpath. + It can target random pods with a Spring Boot application and allows configuring the assaults to inject latency. It tests the resiliency of the system when some applications are having unexpected faulty behavior. + keywords: + - Kubernetes + - K8S + - Spring Boot + - Pod + platforms: + - GKE + - Konvoy + - Packet(Kubeadm) + - Minikube + - EKS + maturity: alpha + maintainers: + - name: Stephane Cazeaux + email: stephane.cazeaux@orange.com + - name: Shubham Chaudhary + email: shubham.chaudhary@harness.io + minKubeVersion: 1.12.0 + provider: + name: Orange + labels: + app.kubernetes.io/component: chartserviceversion + app.kubernetes.io/version: latest + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/spring-boot/spring-boot-latency + - name: Documentation + url: https://litmuschaos.github.io/litmus/experiments/categories/spring-boot/spring-boot-latency + - name: Video + url: + icon: + - url: + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot-latency/experiment.yaml diff --git a/charts/spring-boot/spring-boot-memory-stress/engine.yaml b/charts/spring-boot/spring-boot-memory-stress/engine.yaml new file mode 100644 index 000000000..cbabf2e68 --- /dev/null +++ b/charts/spring-boot/spring-boot-memory-stress/engine.yaml @@ -0,0 +1,34 @@ +apiVersion: litmuschaos.io/v1alpha1 +kind: ChaosEngine +metadata: + name: spring-boot-chaos + namespace: default +spec: + appinfo: + appns: 'default' + applabel: 'app=spring-boot' + appkind: 'deployment' + # It can be active/stop + engineState: 'active' + chaosServiceAccount: spring-boot-memory-stress-sa + experiments: + - name: spring-boot-memory-stress + spec: + components: + env: + # set chaos duration (in sec) as desired + - name: TOTAL_CHAOS_DURATION + value: '30' + + # Cron expression like */1 * * * * ? can be set to enable chaos monkey memory assault on a schedule + - name: CM_MEMORY_CRON + value: '*/1 * * * * ?' + + # Final fraction of used memory by assault. 0.95 equals 95 %. + - name: CM_MEMORY_FILL_TARGET_FRACTION + value: '0.70' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + \ No newline at end of file diff --git a/charts/spring-boot/spring-boot-memory-stress/experiment.yaml b/charts/spring-boot/spring-boot-memory-stress/experiment.yaml new file mode 100644 index 000000000..6861437a0 --- /dev/null +++ b/charts/spring-boot/spring-boot-memory-stress/experiment.yaml @@ -0,0 +1,100 @@ +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + It can target random pods with a Spring Boot application and allows configuring the assaults to inject memory-stress +kind: ChaosExperiment +metadata: + name: spring-boot-memory-stress + labels: + name: spring-boot-memory-stress + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: chaosexperiment + app.kubernetes.io/version: latest +spec: + definition: + scope: Namespaced + permissions: + # Create and monitor the experiment & helper pods + - apiGroups: [ "" ] + resources: [ "pods" ] + verbs: [ "create","delete","get","list","patch","update", "deletecollection" ] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [ "" ] + resources: [ "events" ] + verbs: [ "create","get","list","patch","update" ] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [ "" ] + resources: [ "pods/log" ] + verbs: [ "get","list","watch" ] + # for creating and managing to execute commands inside target container + - apiGroups: [ "" ] + resources: [ "pods/exec" ] + verbs: [ "get","list","create" ] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: [ "batch" ] + resources: [ "jobs" ] + verbs: [ "create","list","get","delete","deletecollection" ] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: [ "litmuschaos.io" ] + resources: [ "chaosengines","chaosexperiments","chaosresults" ] + verbs: [ "create","list","get","patch","update","delete" ] + image: "litmuschaos/go-runner:latest" + imagePullPolicy: Always + args: + - -c + - ./experiments -name spring-boot-memory-stress + command: + - /bin/bash + env: + + # Cron expression like */1 * * * * ? can be set to enable chaos monkey memory assault on a schedule + - name: CM_MEMORY_CRON + value: '*/1 * * * * ?' + + # Duration to assault memory when requested load is reached in ms. + - name: CM_MEMORY_MS_HOLD_FILLED_MEM + value: '30000' + + # Time in ms between increases of memory usage. + - name: CM_MEMORY_MS_NEXT_INCREASE + value: '5000' + + # Fraction of one individual memory increase iteration. 1.0 equals 100 %. + - name: CM_MEMORY_FILL_INC_FRACTION + value: '1.0' + + # Final fraction of used memory by assault. 0.95 equals 95 %. + - name: CM_MEMORY_FILL_TARGET_FRACTION + value: '0.70' + + # provide name of watcher + # it supports controller, restController, service, repository, component, webClient + - name: CM_WATCHERS + value: 'restController' + + - name: TOTAL_CHAOS_DURATION + value: '30' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + ## Period to wait before and after injection of chaos + - name: RAMP_TIME + value: '' + + ## it defines the sequence of chaos execution for multiple target pods + ## supported values: serial, parallel + - name: SEQUENCE + value: 'parallel' + + ## env var that describes the library used to execute the chaos + ## default: litmus. Supported values: litmus + - name: LIB + value: 'litmus' + + labels: + name: spring-boot-memory-stress + app.kubernetes.io/part-of: litmus + app.kubernetes.io/component: experiment-job + app.kubernetes.io/version: latest diff --git a/charts/spring-boot/spring-boot-memory-stress/rbac.yaml b/charts/spring-boot/spring-boot-memory-stress/rbac.yaml new file mode 100644 index 000000000..4b467751f --- /dev/null +++ b/charts/spring-boot/spring-boot-memory-stress/rbac.yaml @@ -0,0 +1,61 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: spring-boot-memory-stress-sa + namespace: default + labels: + name: spring-boot-memory-stress-sa + app.kubernetes.io/part-of: litmus +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: spring-boot-memory-stress-sa + namespace: default + labels: + name: spring-boot-memory-stress-sa + app.kubernetes.io/part-of: litmus +rules: + # Create and monitor the experiment & helper pods + - apiGroups: [""] + resources: ["pods"] + verbs: ["create","delete","get","list","patch","update", "deletecollection"] + # Performs CRUD operations on the events inside chaosengine and chaosresult + - apiGroups: [""] + resources: ["events"] + verbs: ["create","get","list","patch","update"] + # Track and get the runner, experiment, and helper pods log + - apiGroups: [""] + resources: ["pods/log"] + verbs: ["get","list","watch"] + # for creating and managing to execute commands inside target container + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["get","list","create"] + # for configuring and monitor the experiment job by the chaos-runner pod + - apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["create","list","get","delete","deletecollection"] + # for creation, status polling and deletion of litmus chaos resources used within a chaos workflow + - apiGroups: ["litmuschaos.io"] + resources: ["chaosengines","chaosexperiments","chaosresults"] + verbs: ["create","list","get","patch","update","delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: spring-boot-memory-stress-sa + namespace: default + labels: + name: spring-boot-memory-stress-sa + app.kubernetes.io/part-of: litmus +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: spring-boot-memory-stress-sa +subjects: +- kind: ServiceAccount + name: spring-boot-memory-stress-sa + namespace: default + diff --git a/charts/spring-boot/spring-boot-memory-stress/spring-boot-memory-stress.chartserviceversion.yaml b/charts/spring-boot/spring-boot-memory-stress/spring-boot-memory-stress.chartserviceversion.yaml new file mode 100644 index 000000000..568687cf2 --- /dev/null +++ b/charts/spring-boot/spring-boot-memory-stress/spring-boot-memory-stress.chartserviceversion.yaml @@ -0,0 +1,49 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2022-11-17T10:28:08Z + name: spring-boot-memory-stress + version: 0.1.0 + annotations: + categories: Spring Boot + vendor: CNCF + support: https://slack.kubernetes.io/ +spec: + displayName: spring-boot-memory-stress + categoryDescription: | + This experiment allows injecting Chaos Monkey memory-stress assaults on Spring Boot applications, which have the [Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/) in their classpath. + It can target random pods with a Spring Boot application and allows configuring the assaults to inject memory-stress. It tests the resiliency of the system when some applications are having unexpected faulty behavior. + keywords: + - Kubernetes + - K8S + - Spring Boot + - Pod + platforms: + - GKE + - Konvoy + - Packet(Kubeadm) + - Minikube + - EKS + maturity: alpha + maintainers: + - name: Stephane Cazeaux + email: stephane.cazeaux@orange.com + - name: Shubham Chaudhary + email: shubham.chaudhary@harness.io + minKubeVersion: 1.12.0 + provider: + name: Orange + labels: + app.kubernetes.io/component: chartserviceversion + app.kubernetes.io/version: latest + links: + - name: Source Code + url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/spring-boot/spring-boot-memory-stress + - name: Documentation + url: https://litmuschaos.github.io/litmus/experiments/categories/spring-boot/spring-boot-memory-stress + - name: Video + url: + icon: + - url: + mediatype: "" + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot-memory-stress/experiment.yaml diff --git a/charts/spring-boot/spring-boot.chartserviceversion.yaml b/charts/spring-boot/spring-boot.chartserviceversion.yaml new file mode 100644 index 000000000..0c3d58dc9 --- /dev/null +++ b/charts/spring-boot/spring-boot.chartserviceversion.yaml @@ -0,0 +1,39 @@ +apiVersion: litmuchaos.io/v1alpha1 +kind: ChartServiceVersion +metadata: + createdAt: 2022-11-17T10:28:08Z + name: spring-boot + version: 0.1.0 + annotations: + categories: Spring Boot + chartDescription: Injects spring boot chaos +spec: + displayName: Spring Boot Chaos + categoryDescription: > + It contains chaos to disrupt state of spring-boot application. + experiments: + - spring-boot-app-kill + - spring-boot-cpu-stress + - spring-boot-memory-stress + - spring-boot-latency + - spring-boot-exceptions + keywords: + - Kubernetes + - Spring Boot + - K8S + - Pod + maintainers: + - name: Stephane Cazeaux + email: stephane.cazeaux@orange.com + - name: Shubham Chaudhary + email: shubham.chaudhary@harness.io + minKubeVersion: 1.12.0 + provider: + name: Orange + links: + - name: Documentation + url: https://spring.io/projects/spring-boot + icon: + - url: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot/icons/spring-boot.png + mediatype: image/png + chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot/experiments.yaml diff --git a/charts/spring-boot/spring-boot.package.yaml b/charts/spring-boot/spring-boot.package.yaml new file mode 100644 index 000000000..0748b0bcd --- /dev/null +++ b/charts/spring-boot/spring-boot.package.yaml @@ -0,0 +1,17 @@ +packageName: spring-boot +experiments: + - name: spring-boot-app-kill + CSV: spring-boot-app-kill.chartserviceversion.yaml + desc: "spring-boot-app-kill" + - name: spring-boot-cpu-stress + CSV: spring-boot-cpu-stress.chartserviceversion.yaml + desc: "spring-boot-cpu-stress" + - name: spring-boot-memory-stress + CSV: spring-boot-memory-stress.chartserviceversion.yaml + desc: "spring-boot-memory-stress" + - name: spring-boot-latency + CSV: spring-boot-latency.chartserviceversion.yaml + desc: "spring-boot-latency" + - name: spring-boot-exceptions + CSV: spring-boot-exceptions.chartserviceversion.yaml + desc: "spring-boot-exceptions"