1+ name : Helm Node Scaling Test
2+
3+ on :
4+ workflow_call :
5+
6+ env :
7+ SHIM_SPIN_VERSION : v0.19.0
8+ DOCKER_BUILD_SUMMARY : false
9+
10+ jobs :
11+ helm-node-scaling-test :
12+ runs-on : ubuntu-22.04
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Install helm
17+ uses : Azure/setup-helm@v4
18+ with :
19+ version : v3.15.4
20+
21+ - name : Set up QEMU
22+ uses : docker/setup-qemu-action@v3
23+
24+ - name : Set up Docker Buildx
25+ uses : docker/setup-buildx-action@v3
26+
27+ - name : Build RCM
28+ uses : docker/build-push-action@v6
29+ with :
30+ context : .
31+ file : ./Dockerfile
32+ platforms : linux/amd64
33+ cache-from : type=gha
34+ cache-to : type=gha,mode=max
35+ load : true
36+ tags : |
37+ runtime-class-manager:chart-test
38+
39+ - name : Build node installer
40+ uses : docker/build-push-action@v6
41+ with :
42+ context : .
43+ file : ./images/installer/Dockerfile
44+ platforms : linux/amd64
45+ cache-from : type=gha
46+ cache-to : type=gha,mode=max
47+ load : true
48+ tags : |
49+ node-installer:chart-test
50+
51+ - name : Build shim downloader
52+ uses : docker/build-push-action@v6
53+ with :
54+ context : ./images/downloader
55+ file : ./images/downloader/Dockerfile
56+ platforms : linux/amd64
57+ cache-from : type=gha
58+ cache-to : type=gha,mode=max
59+ load : true
60+ tags : |
61+ shim-downloader:chart-test
62+
63+ - name : create kind config
64+ run : |
65+ cat << EOF > kind-config.yaml
66+ kind: Cluster
67+ apiVersion: kind.x-k8s.io/v1alpha4
68+ nodes:
69+ - role: control-plane
70+ - role: worker
71+ labels:
72+ spin: true
73+ EOF
74+
75+ - name : fetch kindscaler script
76+ run : |
77+ curl -so kindscaler.sh https://raw.githubusercontent.com/lobuhi/kindscaler/refs/heads/main/kindscaler.sh
78+ chmod +x kindscaler.sh
79+
80+ - name : create kind cluster
81+ uses : helm/kind-action@v1
82+ with :
83+ cluster_name : kind
84+ config : kind-config.yaml
85+
86+ - name : import images into kind cluster
87+ run : |
88+ kind load docker-image runtime-class-manager:chart-test
89+ kind load docker-image node-installer:chart-test
90+ kind load docker-image shim-downloader:chart-test
91+
92+ - name : helm install runtime-class-manager
93+ run : |
94+ helm install rcm \
95+ --namespace rcm \
96+ --create-namespace \
97+ --debug \
98+ --set image.repository=runtime-class-manager \
99+ --set image.tag=chart-test \
100+ --set rcm.nodeInstallerImage.repository=node-installer \
101+ --set rcm.nodeInstallerImage.tag=chart-test \
102+ --set rcm.shimDownloaderImage.repository=shim-downloader \
103+ --set rcm.shimDownloaderImage.tag=chart-test \
104+ deploy/helm
105+
106+ - name : apply Spin shim
107+ run : |
108+ # Ensure shim binary is compatible with runner arch
109+ yq -i '.spec.fetchStrategy.anonHttp.location = "https://github.com/spinkube/containerd-shim-spin/releases/download/${{ env.SHIM_SPIN_VERSION }}/containerd-shim-spin-v2-linux-x86_64.tar.gz"' \
110+ config/samples/test_shim_spin.yaml
111+ kubectl apply -f config/samples/test_shim_spin.yaml
112+
113+ - name : verify shim is installed into one node
114+ run : |
115+ timeout 1m bash -c 'until [[ "$(kubectl get node -l spin=true -l spin-v2=provisioned -o name | wc -l)" == "1" ]]; do sleep 2; done'
116+ timeout 1m bash -c 'until [[ "$(kubectl get shim.runtime.spinkube.dev/spin-v2 -o json | jq -r '.status.nodesReady')" == "1" ]]; do sleep 2; done'
117+
118+ - name : scale kind worker nodes to 2
119+ run : ./kindscaler.sh kind -r worker -c 1
120+
121+ - name : re-import images into kind cluster, for new node
122+ run : |
123+ kind load docker-image runtime-class-manager:chart-test
124+ kind load docker-image node-installer:chart-test
125+ kind load docker-image shim-downloader:chart-test
126+
127+ - name : verify shim is installed into two nodes
128+ run : |
129+ timeout 1m bash -c 'until [[ "$(kubectl get node -l spin=true -l spin-v2=provisioned -o name | wc -l)" == "2" ]]; do sleep 2; done'
130+ timeout 1m bash -c 'until [[ "$(kubectl get shim.runtime.spinkube.dev/spin-v2 -o json | jq -r '.status.nodesReady')" == "2" ]]; do sleep 2; done'
131+
132+ - name : delete Spin Shim
133+ run : kubectl delete -f config/samples/test_shim_spin.yaml
134+
135+ - name : verify shim is uninstalled from both nodes
136+ run : |
137+ timeout 1m bash -c 'until [[ "$(kubectl get node -l spin=true -l spin-v2=provisioned -o name | wc -l)" == "0" ]]; do sleep 2; done'
138+ timeout 1m bash -c 'until ! kubectl get shims.runtime.spinkube.dev/spin-v2; do sleep 2; done'
139+
140+ - name : debug
141+ if : failure()
142+ run : |
143+ kubectl get pods -A
144+ kubectl describe shim spin-v2
145+ kubectl describe runtimeclass wasmtime-spin-v2
146+ kubectl describe -n rcm pod -l job-name=kind-worker-spin-v2-install || true
147+ kubectl logs -n rcm -l app.kubernetes.io/name=runtime-class-manager || true
148+ kubectl describe -n rcm pod -l app.kubernetes.io/name=runtime-class-manager || true
149+ kubectl describe nodes
0 commit comments