Skip to content

Commit

Permalink
install: Wait for the node to be ready before labeling
Browse files Browse the repository at this point in the history
the labeling itself as well as all the following jobs require functional
node. Let's wait for the node to be up and running before labeling it.

Signed-off-by: Lukáš Doktor <[email protected]>
  • Loading branch information
ldoktor committed Jan 14, 2025
1 parent 3e092c7 commit b8b41ea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions install/pre-install-payload/scripts/reqs-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,15 @@ label_node() {
esac
}

function wait_till_node_is_ready() {
local ready="False"

while ! [[ "${ready}" == "True" ]]; do
sleep 2s
ready=$(kubectl get node $NODE_NAME -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}')
done
}

function print_help() {
echo "Help: ${0} [install/uninstall]"
}
Expand Down Expand Up @@ -319,6 +328,7 @@ function main() {
esac

restart_systemd_service
wait_till_node_is_ready
label_node "${action}"


Expand Down

0 comments on commit b8b41ea

Please sign in to comment.