Skip to content

Commit f41ae89

Browse files
authored
chore(spring-boot): adding spring boot charts (#575)
* chore(spring-boot): adding spring boot charts Signed-off-by: Shubham Chaudhary <[email protected]>
1 parent 6596977 commit f41ae89

33 files changed

+1588
-0
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
2 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: litmuschaos.io/v1alpha1
2+
kind: ChaosEngine
3+
metadata:
4+
name: spring-boot-chaos
5+
namespace: default
6+
spec:
7+
appinfo:
8+
appns: 'default'
9+
applabel: 'app=spring-boot'
10+
appkind: 'deployment'
11+
# It can be active/stop
12+
engineState: 'active'
13+
chaosServiceAccount: spring-boot-app-kill-sa
14+
experiments:
15+
- name: spring-boot-app-kill
16+
spec:
17+
components:
18+
env:
19+
# port of the spring boot application
20+
- name: CM_PORT
21+
value: ''
22+
23+
## percentage of total pods to target
24+
- name: PODS_AFFECTED_PERC
25+
value: ''
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
apiVersion: litmuschaos.io/v1alpha1
2+
description:
3+
message: |
4+
It can target random pods with a Spring Boot application and allows configuring the assaults to inject app-kill
5+
kind: ChaosExperiment
6+
metadata:
7+
name: spring-boot-app-kill
8+
labels:
9+
name: spring-boot-app-kill
10+
app.kubernetes.io/part-of: litmus
11+
app.kubernetes.io/component: chaosexperiment
12+
app.kubernetes.io/version: latest
13+
spec:
14+
definition:
15+
scope: Namespaced
16+
permissions:
17+
# Create and monitor the experiment & helper pods
18+
- apiGroups: [ "" ]
19+
resources: [ "pods" ]
20+
verbs: [ "create","delete","get","list","patch","update", "deletecollection" ]
21+
# Performs CRUD operations on the events inside chaosengine and chaosresult
22+
- apiGroups: [ "" ]
23+
resources: [ "events" ]
24+
verbs: [ "create","get","list","patch","update" ]
25+
# Track and get the runner, experiment, and helper pods log
26+
- apiGroups: [ "" ]
27+
resources: [ "pods/log" ]
28+
verbs: [ "get","list","watch" ]
29+
# for creating and managing to execute commands inside target container
30+
- apiGroups: [ "" ]
31+
resources: [ "pods/exec" ]
32+
verbs: [ "get","list","create" ]
33+
# for configuring and monitor the experiment job by the chaos-runner pod
34+
- apiGroups: [ "batch" ]
35+
resources: [ "jobs" ]
36+
verbs: [ "create","list","get","delete","deletecollection" ]
37+
# for creation, status polling and deletion of litmus chaos resources used within a chaos workflow
38+
- apiGroups: [ "litmuschaos.io" ]
39+
resources: [ "chaosengines","chaosexperiments","chaosresults" ]
40+
verbs: [ "create","list","get","patch","update","delete" ]
41+
image: "litmuschaos/go-runner:latest"
42+
imagePullPolicy: Always
43+
args:
44+
- -c
45+
- ./experiments -name spring-boot-app-kill
46+
command:
47+
- /bin/bash
48+
env:
49+
# port of the spring boot application
50+
- name: CM_PORT
51+
value: ''
52+
53+
#it contains number of requests are to be attacked
54+
# n value means nth request will be affected
55+
- name: CM_LEVEL
56+
value: '1'
57+
58+
# it limits watched packages/classes/methods
59+
- name: CM_WATCHED_CUSTOM_SERVICES
60+
value: ''
61+
62+
# provide name of watcher
63+
# it supports controller, restController, service, repository, component, webClient
64+
- name: CM_WATCHERS
65+
value: 'restController'
66+
67+
## percentage of total pods to target
68+
- name: PODS_AFFECTED_PERC
69+
value: ''
70+
71+
## Period to wait before and after injection of chaos
72+
- name: RAMP_TIME
73+
value: ''
74+
75+
## it defines the sequence of chaos execution for multiple target pods
76+
## supported values: serial, parallel
77+
- name: SEQUENCE
78+
value: 'parallel'
79+
80+
## env var that describes the library used to execute the chaos
81+
## default: litmus. Supported values: litmus
82+
- name: LIB
83+
value: 'litmus'
84+
85+
labels:
86+
name: spring-boot-app-kill
87+
app.kubernetes.io/part-of: litmus
88+
app.kubernetes.io/component: experiment-job
89+
app.kubernetes.io/version: latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: spring-boot-app-kill-sa
6+
namespace: default
7+
labels:
8+
name: spring-boot-app-kill-sa
9+
app.kubernetes.io/part-of: litmus
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: Role
13+
metadata:
14+
name: spring-boot-app-kill-sa
15+
namespace: default
16+
labels:
17+
name: spring-boot-app-kill-sa
18+
app.kubernetes.io/part-of: litmus
19+
rules:
20+
# Create and monitor the experiment & helper pods
21+
- apiGroups: [""]
22+
resources: ["pods"]
23+
verbs: ["create","delete","get","list","patch","update", "deletecollection"]
24+
# Performs CRUD operations on the events inside chaosengine and chaosresult
25+
- apiGroups: [""]
26+
resources: ["events"]
27+
verbs: ["create","get","list","patch","update"]
28+
# Track and get the runner, experiment, and helper pods log
29+
- apiGroups: [""]
30+
resources: ["pods/log"]
31+
verbs: ["get","list","watch"]
32+
# for creating and managing to execute commands inside target container
33+
- apiGroups: [""]
34+
resources: ["pods/exec"]
35+
verbs: ["get","list","create"]
36+
# for configuring and monitor the experiment job by the chaos-runner pod
37+
- apiGroups: ["batch"]
38+
resources: ["jobs"]
39+
verbs: ["create","list","get","delete","deletecollection"]
40+
# for creation, status polling and deletion of litmus chaos resources used within a chaos workflow
41+
- apiGroups: ["litmuschaos.io"]
42+
resources: ["chaosengines","chaosexperiments","chaosresults"]
43+
verbs: ["create","list","get","patch","update","delete"]
44+
---
45+
apiVersion: rbac.authorization.k8s.io/v1
46+
kind: RoleBinding
47+
metadata:
48+
name: spring-boot-app-kill-sa
49+
namespace: default
50+
labels:
51+
name: spring-boot-app-kill-sa
52+
app.kubernetes.io/part-of: litmus
53+
roleRef:
54+
apiGroup: rbac.authorization.k8s.io
55+
kind: Role
56+
name: spring-boot-app-kill-sa
57+
subjects:
58+
- kind: ServiceAccount
59+
name: spring-boot-app-kill-sa
60+
namespace: default
61+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apiVersion: litmuchaos.io/v1alpha1
2+
kind: ChartServiceVersion
3+
metadata:
4+
createdAt: 2022-11-17T10:28:08Z
5+
name: spring-boot-app-kill
6+
version: 0.1.0
7+
annotations:
8+
categories: Spring Boot
9+
vendor: CNCF
10+
support: https://slack.kubernetes.io/
11+
spec:
12+
displayName: spring-boot-app-kill
13+
categoryDescription: |
14+
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.
15+
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.
16+
keywords:
17+
- Kubernetes
18+
- K8S
19+
- Spring Boot
20+
- Pod
21+
platforms:
22+
- GKE
23+
- Konvoy
24+
- Packet(Kubeadm)
25+
- Minikube
26+
- EKS
27+
maturity: alpha
28+
maintainers:
29+
- name: Stephane Cazeaux
30+
31+
- name: Shubham Chaudhary
32+
33+
minKubeVersion: 1.12.0
34+
provider:
35+
name: Orange
36+
labels:
37+
app.kubernetes.io/component: chartserviceversion
38+
app.kubernetes.io/version: latest
39+
links:
40+
- name: Source Code
41+
url: https://github.com/litmuschaos/litmus-go/tree/master/experiments/spring-boot/spring-boot-app-kill
42+
- name: Documentation
43+
url: https://litmuschaos.github.io/litmus/experiments/categories/spring-boot/spring-boot-app-kill
44+
- name: Video
45+
url:
46+
icon:
47+
- url:
48+
mediatype: ""
49+
chaosexpcrdlink: https://raw.githubusercontent.com/litmuschaos/chaos-charts/master/charts/spring-boot-app-kill/experiment.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: litmuschaos.io/v1alpha1
2+
kind: ChaosEngine
3+
metadata:
4+
name: spring-boot-chaos
5+
namespace: default
6+
spec:
7+
appinfo:
8+
appns: 'default'
9+
applabel: 'app=spring-boot'
10+
appkind: 'deployment'
11+
# It can be active/stop
12+
engineState: 'active'
13+
chaosServiceAccount: spring-boot-cpu-stress-sa
14+
experiments:
15+
- name: spring-boot-cpu-stress
16+
spec:
17+
components:
18+
env:
19+
# set chaos duration (in sec) as desired
20+
- name: TOTAL_CHAOS_DURATION
21+
value: '30'
22+
23+
# it contains fraction of used cpu. 0.95 equals 95%.
24+
# it supports value in range [0.1,1.0]
25+
- name: CPU_LOAD_FRACTION
26+
value: '0.9'
27+
28+
# port of the spring boot application
29+
- name: CM_PORT
30+
value: ''
31+
32+
## percentage of total pods to target
33+
- name: PODS_AFFECTED_PERC
34+
value: ''
35+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
apiVersion: litmuschaos.io/v1alpha1
2+
description:
3+
message: |
4+
It can target random pods with a Spring Boot application and allows configuring the assaults to inject cpu-stress
5+
kind: ChaosExperiment
6+
metadata:
7+
name: spring-boot-cpu-stress
8+
labels:
9+
name: spring-boot-cpu-stress
10+
app.kubernetes.io/part-of: litmus
11+
app.kubernetes.io/component: chaosexperiment
12+
app.kubernetes.io/version: latest
13+
spec:
14+
definition:
15+
scope: Namespaced
16+
permissions:
17+
# Create and monitor the experiment & helper pods
18+
- apiGroups: [ "" ]
19+
resources: [ "pods" ]
20+
verbs: [ "create","delete","get","list","patch","update", "deletecollection" ]
21+
# Performs CRUD operations on the events inside chaosengine and chaosresult
22+
- apiGroups: [ "" ]
23+
resources: [ "events" ]
24+
verbs: [ "create","get","list","patch","update" ]
25+
# Track and get the runner, experiment, and helper pods log
26+
- apiGroups: [ "" ]
27+
resources: [ "pods/log" ]
28+
verbs: [ "get","list","watch" ]
29+
# for creating and managing to execute commands inside target container
30+
- apiGroups: [ "" ]
31+
resources: [ "pods/exec" ]
32+
verbs: [ "get","list","create" ]
33+
# for configuring and monitor the experiment job by the chaos-runner pod
34+
- apiGroups: [ "batch" ]
35+
resources: [ "jobs" ]
36+
verbs: [ "create","list","get","delete","deletecollection" ]
37+
# for creation, status polling and deletion of litmus chaos resources used within a chaos workflow
38+
- apiGroups: [ "litmuschaos.io" ]
39+
resources: [ "chaosengines","chaosexperiments","chaosresults" ]
40+
verbs: [ "create","list","get","patch","update","delete" ]
41+
image: "litmuschaos/go-runner:latest"
42+
imagePullPolicy: Always
43+
args:
44+
- -c
45+
- ./experiments -name spring-boot-cpu-stress
46+
command:
47+
- /bin/bash
48+
env:
49+
50+
# it contains fraction of cpu to be stressed(0.95 equals 95%)
51+
# it supports value in range [0.1,1.0]
52+
- name: CPU_LOAD_FRACTION
53+
value: '0.9'
54+
55+
# port of the spring boot application
56+
- name: CM_PORT
57+
value: ''
58+
59+
#it contains number of requests are to be attacked
60+
# n value means nth request will be affected
61+
- name: CM_LEVEL
62+
value: '1'
63+
64+
# it limits watched packages/classes/methods
65+
- name: CM_WATCHED_CUSTOM_SERVICES
66+
value: ''
67+
68+
# provide name of watcher
69+
# it supports controller, restController, service, repository, component, webClient
70+
- name: CM_WATCHERS
71+
value: 'restController'
72+
73+
- name: TOTAL_CHAOS_DURATION
74+
value: '30'
75+
76+
## percentage of total pods to target
77+
- name: PODS_AFFECTED_PERC
78+
value: ''
79+
80+
## Period to wait before and after injection of chaos
81+
- name: RAMP_TIME
82+
value: ''
83+
84+
## it defines the sequence of chaos execution for multiple target pods
85+
## supported values: serial, parallel
86+
- name: SEQUENCE
87+
value: 'parallel'
88+
89+
## env var that describes the library used to execute the chaos
90+
## default: litmus. Supported values: litmus
91+
- name: LIB
92+
value: 'litmus'
93+
94+
labels:
95+
name: spring-boot-cpu-stress
96+
app.kubernetes.io/part-of: litmus
97+
app.kubernetes.io/component: experiment-job
98+
app.kubernetes.io/version: latest

0 commit comments

Comments
 (0)