File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ inputs:
1010 description : " Name of the KinD cluster"
1111 required : false
1212 default : cluster
13+ worker-nodes :
14+ description : " Number of worker nodes"
15+ required : false
16+ default : 0
17+ label-prefix :
18+ description : " Prefix to add to worker node labels"
19+ required : false
20+ default : worker
1321
1422runs :
1523 using : " composite"
@@ -29,11 +37,23 @@ runs:
2937 run : |
3038 podman run -d -p 5000:5000 --name registry registry:2.8.1
3139
40+ export NODE_IMAGE="kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1"
41+
3242 export REGISTRY_ADDRESS=$(hostname -i):5000
3343 echo "REGISTRY_ADDRESS=${REGISTRY_ADDRESS}" >> $GITHUB_ENV
3444 echo "Container image registry started at ${REGISTRY_ADDRESS}"
3545
3646 KIND_CONFIG_FILE=${{ env.TEMP_DIR }}/kind.yaml
47+
48+ WORKER_NODES=${{ inputs.worker-nodes }}
49+ LABEL_PREFIX=${{ inputs.label-prefix }}
50+
51+ if [ "$WORKER_NODES" -gt 0 ]; then
52+ for i in $(seq 1 $WORKER_NODES); do
53+ sed -i "/^nodes:/a \ \ - role: worker\n image: ${NODE_IMAGE}\n labels:\n ${LABEL_PREFIX}-${i}: true" ${GITHUB_ACTION_PATH}/resources/kind.yaml
54+ done
55+ fi
56+
3757 echo "KIND_CONFIG_FILE=${KIND_CONFIG_FILE}" >> $GITHUB_ENV
3858 envsubst < ${GITHUB_ACTION_PATH}/resources/kind.yaml > ${KIND_CONFIG_FILE}
3959
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ kind: Cluster
1818apiVersion : kind.x-k8s.io/v1alpha4
1919nodes :
2020 - role : control-plane
21- image : kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
21+ image : ${NODE_IMAGE}
2222 extraMounts :
2323 - hostPath : /dev/null
2424 containerPath : /var/run/nvidia-container-devices/all
You can’t perform that action at this time.
0 commit comments