Skip to content

Commit b962709

Browse files
committed
chore(spring-boot): adding spring boot charts
Signed-off-by: Shubham Chaudhary <shubham.chaudhary@harness.io>
1 parent 7c18aea commit b962709

29 files changed

+1298
-0
lines changed

.idea/workspace.xml

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2 KB
Loading
2 KB
Loading
2 KB
Loading
2 KB
Loading
2 KB
Loading
2 KB
Loading
Lines changed: 30 additions & 0 deletions
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+
Lines changed: 84 additions & 0 deletions
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
Lines changed: 61 additions & 0 deletions
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+

0 commit comments

Comments
 (0)