Skip to content

Commit baf3abb

Browse files
authored
Merge 2396106 into e14a747
2 parents e14a747 + 2396106 commit baf3abb

12 files changed

+259
-7
lines changed
+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Kind Chaos Mesh CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "**.yaml"
9+
- ".github/workflows/kind-chaos-mesh-ci.yml"
10+
pull_request:
11+
paths:
12+
- "**.yaml"
13+
- ".github/workflows/kind-chaos-mesh-ci.yml"
14+
15+
jobs:
16+
chaos-mesh-ci:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Kind Cluster
20+
uses: helm/kind-action@v1.1.0
21+
22+
- name: Print cluster information
23+
run: |
24+
kubectl config view
25+
kubectl cluster-info
26+
kubectl get nodes
27+
kubectl get pods -n kube-system
28+
helm version
29+
kubectl version
30+
- uses: actions/checkout@v2
31+
32+
- name: Deploy an application
33+
run: |
34+
kubectl apply -f kubernetes/mysql/mysql-pv.yaml
35+
kubectl apply -f kubernetes/mysql/mysql-pvc.yaml
36+
kubectl apply -f kubernetes/mysql/mysql-configmap.yaml
37+
kubectl apply -f kubernetes/mysql/mysql-secret.yaml
38+
kubectl apply -f kubernetes/mysql/mysql-deployment.yaml
39+
kubectl apply -f kubernetes/mysql/mysql-service.yaml
40+
kubectl apply -f kubernetes/jaxrs-mysql-quarkus/jaxrs-mysql-quarkus-service.yaml
41+
kubectl apply -f kubernetes/jaxrs-mysql-quarkus/jaxrs-mysql-quarkus-deployment.yaml
42+
43+
- name: Wait pod status to running
44+
run: |
45+
kubectl wait --all-namespaces=true --for=condition=ready pod -l component=quarkus --timeout=3m
46+
kubectl wait --all-namespaces=true --for=condition=ready pod -l app=mysql --timeout=3m
47+
48+
- name: Check pods
49+
run: |
50+
kubectl get pods -n chaos-testing
51+
kubectl get pods
52+
53+
- name: Chaos Mesh
54+
uses: chaos-mesh/chaos-mesh-action@v0.4
55+
env:
56+
# base64 container-kill.yaml
57+
CFG_BASE64: YXBpVmVyc2lvbjogY2hhb3MtbWVzaC5vcmcvdjFhbHBoYTENCmtpbmQ6IFBvZENoYW9zDQptZXRhZGF0YToNCiAgbmFtZTogY29udGFpbmVyLWtpbGwNCiAgbmFtZXNwYWNlOiBjaGFvcy10ZXN0aW5nDQpzcGVjOg0KICBhY3Rpb246IGNvbnRhaW5lci1raWxsDQogIG1vZGU6IG9uZQ0KICBjb250YWluZXJOYW1lOiAibXlzcWwiDQogIHNlbGVjdG9yOg0KICAgIG5hbWVzcGFjZXM6DQogICAgICAtIGRlZmF1bHQNCiAgICBsYWJlbFNlbGVjdG9yczoNCiAgICAgICJhcHAiOiAibXlzcWwiDQogIHNjaGVkdWxlcjoNCiAgICBjcm9uOiAiQGV2ZXJ5IDEwbSINCg==
58+
CHAOS_MESH_VERSION: v1.0.0
59+
60+
- name: Check pods
61+
run: |
62+
for i in `seq 10`
63+
do
64+
kubectl get pods -n chaos-testing
65+
kubectl get pods
66+
sleep 1
67+
done
68+
69+
- name: check log jaxrs-mysql
70+
if: always()
71+
run: |
72+
kubectl describe po $(kubectl get pods | awk '{print $1}' | grep jaxrs-mysql)
73+
kubectl logs $(kubectl get pods | awk '{print $1}' | grep jaxrs-mysql)
74+
75+
- name: check log mysql
76+
if: always()
77+
run: |
78+
kubectl describe po $(kubectl get pods | awk '{print $1}' | grep -E ^mysql)
79+
kubectl logs $(kubectl get pods | awk '{print $1}' | grep -E ^mysql) -c mysql
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: StressChaos
3+
metadata:
4+
name: burn-cpu
5+
namespace: chaos-testing
6+
spec:
7+
mode: one
8+
selector:
9+
namespaces:
10+
- default
11+
labelSelectors:
12+
"component": "quarkus"
13+
stressors:
14+
cpu:
15+
workers: 1
16+
duration: "30s"
17+
scheduler:
18+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: PodChaos
3+
metadata:
4+
name: container-kill
5+
namespace: chaos-testing
6+
spec:
7+
action: container-kill
8+
mode: one
9+
containerName: "mysql"
10+
selector:
11+
namespaces:
12+
- default
13+
labelSelectors:
14+
"app": "mysql"
15+
scheduler:
16+
cron: "@every 10m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: IoChaos
3+
metadata:
4+
name: io-delay
5+
namespace: chaos-testing
6+
spec:
7+
action: latency
8+
mode: one
9+
selector:
10+
namespaces:
11+
- default
12+
labelSelectors:
13+
"component": "quarkus"
14+
volumePath: /
15+
path: /
16+
delay: "10ms"
17+
percent: 50
18+
duration: "400s"
19+
scheduler:
20+
cron: "@every 10m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: NetworkChaos
3+
metadata:
4+
name: network-corrupt
5+
namespace: chaos-testing
6+
spec:
7+
action: corrupt
8+
mode: one
9+
selector:
10+
namespaces:
11+
- default
12+
labelSelectors:
13+
"component": "quarkus"
14+
corrupt:
15+
corrupt: "40"
16+
correlation: "25"
17+
duration: "10s"
18+
scheduler:
19+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: NetworkChaos
3+
metadata:
4+
name: network-delay
5+
namespace: chaos-testing
6+
spec:
7+
action: delay
8+
mode: one
9+
selector:
10+
namespaces:
11+
- default
12+
labelSelectors:
13+
"component": "quarkus"
14+
delay:
15+
latency: "90ms"
16+
correlation: "25"
17+
jitter: "90ms"
18+
duration: "10s"
19+
scheduler:
20+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: NetworkChaos
3+
metadata:
4+
name: network-duplicate
5+
namespace: chaos-testing
6+
spec:
7+
action: duplicate
8+
mode: one
9+
selector:
10+
namespaces:
11+
- default
12+
labelSelectors:
13+
"component": "quarkus"
14+
duplicate:
15+
duplicate: "40"
16+
correlation: "25"
17+
duration: "10s"
18+
scheduler:
19+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: NetworkChaos
3+
metadata:
4+
name: network-loss
5+
namespace: chaos-testing
6+
spec:
7+
action: loss
8+
mode: one
9+
selector:
10+
namespaces:
11+
- default
12+
labelSelectors:
13+
"component": "quarkus"
14+
loss:
15+
loss: "25"
16+
correlation: "25"
17+
duration: "10s"
18+
scheduler:
19+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: NetworkChaos
3+
metadata:
4+
name: network-partition-example
5+
namespace: chaos-testing
6+
spec:
7+
action: partition
8+
mode: one
9+
selector:
10+
namespaces:
11+
- default
12+
labelSelectors:
13+
"component": "quarkus"
14+
direction: to
15+
target:
16+
selector:
17+
namespaces:
18+
- default
19+
labelSelectors:
20+
"component": "quarkus"
21+
mode: one
22+
duration: "10s"
23+
scheduler:
24+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
apiVersion: chaos-mesh.org/v1alpha1
22
kind: PodChaos
33
metadata:
4-
name: pod-failure-example
4+
name: pod-failure
55
namespace: chaos-testing
66
spec:
77
action: pod-failure
88
mode: one
99
value: ""
10-
duration: "30s"
10+
duration: "10s"
1111
selector:
1212
namespaces:
1313
- default
1414
labelSelectors:
15-
"app": "jaxrs-rabbitmq-quarkus"
15+
"component": "quarkus"
1616
scheduler:
17-
cron: "@every 1m"
17+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: chaos-mesh.org/v1alpha1
22
kind: PodChaos
33
metadata:
4-
name: pod-kill-example
4+
name: pod-kill
55
namespace: chaos-testing
66
spec:
77
action: pod-kill
@@ -10,6 +10,6 @@ spec:
1010
namespaces:
1111
- default
1212
labelSelectors:
13-
"app": "nginx"
13+
"component": "quarkus"
1414
scheduler:
15-
cron: "@every 1m"
15+
cron: "@every 2m"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: chaos-mesh.org/v1alpha1
2+
kind: TimeChaos
3+
metadata:
4+
name: time-shift-example
5+
namespace: chaos-testing
6+
spec:
7+
mode: one
8+
selector:
9+
namespaces:
10+
- default
11+
labelSelectors:
12+
"component": "quarkus"
13+
timeOffset: "-1.5h"
14+
clockIds:
15+
- CLOCK_REALTIME
16+
duration: "30s"
17+
scheduler:
18+
cron: "@every 2m"

0 commit comments

Comments
 (0)