-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (66 loc) · 2.96 KB
/
chaos-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Chaos Testing
on:
workflow_call:
permissions: read-all
jobs:
run-chaos-tests:
name: run chaos tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Build image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
push: false
load: true
context: tests/chaos/tester
tags: |
ghcr.io/miracum/recruit/chaos-tester:v1
- name: Create KinD cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind
- name: Load images into KinD
run: |
kind load docker-image ghcr.io/miracum/recruit/chaos-tester:v1
- name: List images in cluster
run: docker exec kind-control-plane crictl images
- name: Install chaos testing prerequisites
working-directory: tests/chaos
run: |
curl -sL -o - https://github.com/argoproj/argo-workflows/releases/download/v3.4.3/argo-linux-amd64.gz | gunzip > argo
chmod +x ./argo
kubectl create ns recruit
kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.18/releases/cnpg-1.18.0.yaml
kubectl wait --for=condition=ready pod \
-n cnpg-system \
--selector='app.kubernetes.io/name=cloudnative-pg' \
--timeout=5m
kubectl apply -f cnpg.yaml -n recruit
helm repo add chaos-mesh https://charts.chaos-mesh.org
helm upgrade --install chaos-mesh chaos-mesh/chaos-mesh \
--create-namespace \
-n chaos-mesh \
--set chaosDaemon.runtime=containerd \
--set chaosDaemon.socketPath='/run/containerd/containerd.sock' \
--version 2.4.3
kubectl apply -f chaos-mesh-rbac.yaml
helm repo add argo https://argoproj.github.io/argo-helm
helm upgrade --install argo-workflows argo/argo-workflows \
--create-namespace \
-n argo-workflows \
-f argo-workflows-values.yaml \
--version 0.20.8
- name: Install and scale-up recruIT
working-directory: tests/chaos
run: |
helm upgrade --install -n recruit -f recruit-values.yaml --set notify.replicaCount=1 --wait recruit ../../charts/recruit
helm upgrade --install -n recruit -f recruit-values.yaml --set notify.replicaCount=2 --wait recruit ../../charts/recruit
helm upgrade --install -n recruit -f recruit-values.yaml --set notify.replicaCount=3 --wait recruit ../../charts/recruit
- name: Run chaos testing workflow
working-directory: tests/chaos
run: |
./argo submit argo-workflow.yaml -n recruit --wait --log