mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-02-15 03:24:30 +01:00
kata-deploy: Ensure node is ready after CRI Engine restart
Let's ensure the node is ready after the CRI Engine restart, otherwise
we may proceed and scripts may simply fail if they try to deploy a pod
while the CRI Engine is not yet restarted (and, consequently, the node
is not Ready).
Related: #6649
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
(cherry picked from commit 3b76abb366)
This commit is contained in:
@@ -62,6 +62,15 @@ function install_artifacts() {
|
||||
chmod +x /opt/kata/runtime-rs/bin/*
|
||||
}
|
||||
|
||||
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 configure_cri_runtime() {
|
||||
configure_different_shims_base
|
||||
|
||||
@@ -75,6 +84,8 @@ function configure_cri_runtime() {
|
||||
esac
|
||||
systemctl daemon-reload
|
||||
systemctl restart "$1"
|
||||
|
||||
wait_till_node_is_ready
|
||||
}
|
||||
|
||||
function configure_different_shims_base() {
|
||||
@@ -265,6 +276,8 @@ function reset_runtime() {
|
||||
if [ "$1" == "crio" ] || [ "$1" == "containerd" ]; then
|
||||
systemctl restart kubelet
|
||||
fi
|
||||
|
||||
wait_till_node_is_ready
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
Reference in New Issue
Block a user