-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathhelm-chart-node-scaling-test.yml
More file actions
149 lines (126 loc) · 5.33 KB
/
Copy pathhelm-chart-node-scaling-test.yml
File metadata and controls
149 lines (126 loc) · 5.33 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Helm Node Scaling Test
on:
workflow_call:
permissions:
contents: read
env:
SHIM_SPIN_VERSION: v0.23.0
DOCKER_BUILD_SUMMARY: false
jobs:
helm-node-scaling-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install helm
uses: Azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v3.15.4
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Build RCM
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
tags: |
runtime-class-manager:chart-test
- name: Build node installer
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: .
file: ./images/installer/Dockerfile
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
tags: |
node-installer:chart-test
- name: Build shim downloader
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: ./images/downloader
file: ./images/downloader/Dockerfile
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
tags: |
shim-downloader:chart-test
- name: create kind config
run: |
cat << EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
labels:
spin: true
EOF
- name: fetch kindscaler script
run: |
curl -so kindscaler.sh https://raw.githubusercontent.com/lobuhi/kindscaler/refs/heads/main/kindscaler.sh
chmod +x kindscaler.sh
- name: create kind cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
cluster_name: kind
config: kind-config.yaml
- name: import images into kind cluster
run: |
kind load docker-image runtime-class-manager:chart-test
kind load docker-image node-installer:chart-test
kind load docker-image shim-downloader:chart-test
- name: helm install runtime-class-manager
run: |
helm install rcm \
--namespace rcm \
--create-namespace \
--debug \
--set image.repository=runtime-class-manager \
--set image.tag=chart-test \
--set rcm.nodeInstallerImage.repository=node-installer \
--set rcm.nodeInstallerImage.tag=chart-test \
--set rcm.shimDownloaderImage.repository=shim-downloader \
--set rcm.shimDownloaderImage.tag=chart-test \
deploy/helm
- name: apply Spin shim
run: |
kubectl apply -f config/samples/test_shim_spin.yaml
- name: verify shim is installed into one node
run: |
timeout 1m bash -c 'until [[ "$(kubectl get node -l spin=true -l spin-v2=provisioned -o name | wc -l)" == "1" ]]; do sleep 2; done'
timeout 1m bash -c 'until [[ "$(kubectl get shim.runtime.spinkube.dev/spin-v2 -o json | jq -r '.status.nodesReady')" == "1" ]]; do sleep 2; done'
- name: scale kind worker nodes to 2
run: ./kindscaler.sh kind -r worker -c 1
- name: re-import images into kind cluster, for new node
run: |
kind load docker-image runtime-class-manager:chart-test
kind load docker-image node-installer:chart-test
kind load docker-image shim-downloader:chart-test
- name: verify shim is installed into two nodes
run: |
timeout 1m bash -c 'until [[ "$(kubectl get node -l spin=true -l spin-v2=provisioned -o name | wc -l)" == "2" ]]; do sleep 2; done'
timeout 1m bash -c 'until [[ "$(kubectl get shim.runtime.spinkube.dev/spin-v2 -o json | jq -r '.status.nodesReady')" == "2" ]]; do sleep 2; done'
- name: delete Spin Shim
run: kubectl delete -f config/samples/test_shim_spin.yaml
- name: verify shim is uninstalled from both nodes
run: |
timeout 1m bash -c 'until [[ "$(kubectl get node -l spin=true -l spin-v2=provisioned -o name | wc -l)" == "0" ]]; do sleep 2; done'
timeout 1m bash -c 'until ! kubectl get shims.runtime.spinkube.dev/spin-v2; do sleep 2; done'
- name: debug
if: failure()
run: |
kubectl get pods -A
kubectl describe shim spin-v2
kubectl describe runtimeclass wasmtime-spin-v2
kubectl describe -n rcm pod -l job-name=kind-worker-spin-v2-install || true
kubectl logs -n rcm -l app.kubernetes.io/name=runtime-class-manager || true
kubectl describe -n rcm pod -l app.kubernetes.io/name=runtime-class-manager || true
kubectl describe nodes