e2e test: wait for specified amount of nodes to join the cluster and become ready (#87)

Co-authored-by: Nils Hanke <Nirusu@users.noreply.github.com>
This commit is contained in:
Malte Poll 2022-09-09 13:28:53 +02:00 committed by GitHub
parent 56accc7766
commit aa75a065d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,11 +155,36 @@ runs:
if: ${{ inputs.isDebugImage == 'true' }}
- name: Constellation init
id: constellation-init
run: |
if [ ${{ inputs.autoscale }} = true ]; then autoscale=--autoscale; fi
constellation init ${autoscale}
echo "::set-output name=KUBECONFIG::$(pwd)/constellation-admin.conf"
shell: bash
- name: Wait for nodes to join and become ready
run: |
echo "::group::Wait for nodes"
NODES_COUNT=$((${{ inputs.controlNodesCount }} + ${{ inputs.workerNodesCount }}))
JOINWAIT=0
until [ "$(kubectl get nodes -o json | jq '.items | length')" == "${NODES_COUNT}" ] || [ $JOINWAIT -gt $JOINTIMEOUT ];
do
echo "$(kubectl get nodes -o json | jq '.items | length')/"${NODES_COUNT}" nodes have joined.. waiting.."
JOINWAIT=$((JOINWAIT+30))
sleep 30
done
if [ $JOINWAIT -gt $JOINTIMEOUT ]; then
echo "Timed out waiting for nodes to join"
exit 1
fi
echo "$(kubectl get nodes -o json | jq '.items | length')/"${NODES_COUNT}" nodes have joined"
kubectl wait --for=condition=ready --all nodes --timeout=10m
echo "::endgroup::"
shell: bash
env:
KUBECONFIG: "${{ steps.constellation-init.outputs.KUBECONFIG }}"
JOINTIMEOUT: "1200" # 20 minutes timeout for all nodes to join
- name: Download boot logs
run: |
echo "::group::Download boot logs"