-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (69 loc) · 3.02 KB
/
chaos-test.yaml
File metadata and controls
86 lines (69 loc) · 3.02 KB
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
84
85
86
name: Chaos Testing
on:
workflow_call:
permissions:
contents: read
jobs:
run-chaos-tests:
name: run chaos tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.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@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.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