Skip to content

Commit b962709

Browse files
committed
chore(spring-boot): adding spring boot charts
Signed-off-by: Shubham Chaudhary <[email protected]>
1 parent 7c18aea commit b962709

29 files changed

+1298
-0
lines changed

.idea/workspace.xml

+74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
Loading
Loading
Loading
Loading
2 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
# set chaos duration (in sec) as desired
20+
- name: TOTAL_CHAOS_DURATION
21+
value: '30'
22+
23+
# Cron expression like */1 * * * * ? can be set to enable chaos monkey AppKiller assault on a schedule
24+
- name: CM_KILL_APPLICATION_CRON
25+
value: '*/1 * * * * ?'
26+
27+
## percentage of total pods to target
28+
- name: PODS_AFFECTED_PERC
29+
value: ''
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
50+
# Cron expression like */1 * * * * ? can be set to enable chaos monkey AppKiller assault on a schedule
51+
- name: CM_KILL_APPLICATION_CRON
52+
value: ''
53+
54+
# provide name of watcher
55+
# it supports controller, restController, service, repository, component, webClient
56+
- name: CM_WATCHERS
57+
value: 'restController'
58+
59+
- name: TOTAL_CHAOS_DURATION
60+
value: '30'
61+
62+
## percentage of total pods to target
63+
- name: PODS_AFFECTED_PERC
64+
value: ''
65+
66+
## Period to wait before and after injection of chaos
67+
- name: RAMP_TIME
68+
value: ''
69+
70+
## it defines the sequence of chaos execution for multiple target pods
71+
## supported values: serial, parallel
72+
- name: SEQUENCE
73+
value: 'parallel'
74+
75+
## env var that describes the library used to execute the chaos
76+
## default: litmus. Supported values: litmus
77+
- name: LIB
78+
value: 'litmus'
79+
80+
labels:
81+
name: spring-boot-app-kill
82+
app.kubernetes.io/part-of: litmus
83+
app.kubernetes.io/component: experiment-job
84+
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,34 @@
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+
# Cron expression like */1 * * * * ? can be set to enable cpu assault on a schedule
24+
- name: CM_CPU_CRON
25+
value: '*/1 * * * * ?'
26+
27+
# Final fraction of used cpu by assault. 0.95 equals 95 %.
28+
- name: CM_CPU_LOAD_TARGET_FRACTION
29+
value: '0.8'
30+
31+
## percentage of total pods to target
32+
- name: PODS_AFFECTED_PERC
33+
value: ''
34+

0 commit comments

Comments
 (0)