ci: fix recover wait condition (#2257)

This commit is contained in:
3u13r 2023-08-18 10:43:51 +02:00 committed by GitHub
parent 5cf2a59c2c
commit 38dcb3dbab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,8 +18,14 @@ runs:
KUBECONFIG: ${{ inputs.kubeconfig }}
run: |
WORKER_NODE=$(kubectl get nodes --selector='!node-role.kubernetes.io/control-plane' -o json | jq '.items[0].metadata.name' -r)
echo "Disabling the join-service and waiting for the node to be unresponsive"
kubectl patch daemonset -n kube-system join-service -p '{"spec":{"template":{"spec":{"nodeSelector":{"some-tag":""}}}}}'
kubectl debug node/$WORKER_NODE --image=ubuntu -- bash -c "echo reboot > reboot.sh && chroot /host < reboot.sh"
kubectl wait --for=condition=Ready=false --timeout=10m node/$WORKER_NODE
kubectl wait --for=condition=Ready=Unknown --timeout=10m node/$WORKER_NODE
echo "Re-enabling the join-service and waiting for the node to be back up"
kubectl patch daemonset -n kube-system join-service --type=json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/some-tag"}]'
kubectl wait --for=condition=Ready=true --timeout=10m --all nodes
- name: Restart all control plane nodes