From e9c0bebc52e9f6b782a53e79db4930316363d77a Mon Sep 17 00:00:00 2001 From: sergey kryazhev Date: Mon, 16 Sep 2024 19:09:15 +0300 Subject: [PATCH 1/3] add containerd health check after restart --- kubemarine/cri/containerd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kubemarine/cri/containerd.py b/kubemarine/cri/containerd.py index 15f203393..3d26ed5d7 100755 --- a/kubemarine/cri/containerd.py +++ b/kubemarine/cri/containerd.py @@ -299,10 +299,12 @@ def configure_containerd(group: NodeGroup) -> RunnersGroupResult: backup=True, sudo=True, mkdir=True) log.debug("Restarting Containerd on %s node..." % node.get_node_name()) + # to restart and wait untill containerd is up2running node.sudo( f"chmod 600 {os_specific_associations['config_location']} && " f"sudo systemctl restart {os_specific_associations['service_name']} && " - f"systemctl status {os_specific_associations['service_name']}", callback=collector) + f"systemctl status {os_specific_associations['service_name']} && " + f"timeout 10 sh -c 'until sudo crictl info 2>&1; do sleep 1; done' ", callback=collector) return collector.result From d8121fbe73929df54062a4afffc84efc9c9154a2 Mon Sep 17 00:00:00 2001 From: sergey kryazhev Date: Mon, 16 Sep 2024 19:33:27 +0300 Subject: [PATCH 2/3] replaced crictl with ctr --- kubemarine/cri/containerd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubemarine/cri/containerd.py b/kubemarine/cri/containerd.py index 3d26ed5d7..69d43d238 100755 --- a/kubemarine/cri/containerd.py +++ b/kubemarine/cri/containerd.py @@ -304,7 +304,7 @@ def configure_containerd(group: NodeGroup) -> RunnersGroupResult: f"chmod 600 {os_specific_associations['config_location']} && " f"sudo systemctl restart {os_specific_associations['service_name']} && " f"systemctl status {os_specific_associations['service_name']} && " - f"timeout 10 sh -c 'until sudo crictl info 2>&1; do sleep 1; done' ", callback=collector) + f"timeout 10 sh -c 'until sudo ctr version 2>&1; do sleep 1; done' ", callback=collector) return collector.result From babe06dbddd509164c88518e9b4534cdf98a2233 Mon Sep 17 00:00:00 2001 From: koryaga <5212888+koryaga@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:05:41 +0300 Subject: [PATCH 3/3] Update containerd.py --- kubemarine/cri/containerd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubemarine/cri/containerd.py b/kubemarine/cri/containerd.py index 69d43d238..252683a95 100755 --- a/kubemarine/cri/containerd.py +++ b/kubemarine/cri/containerd.py @@ -299,7 +299,7 @@ def configure_containerd(group: NodeGroup) -> RunnersGroupResult: backup=True, sudo=True, mkdir=True) log.debug("Restarting Containerd on %s node..." % node.get_node_name()) - # to restart and wait untill containerd is up2running + # to restart and wait untill containerd is up&running node.sudo( f"chmod 600 {os_specific_associations['config_location']} && " f"sudo systemctl restart {os_specific_associations['service_name']} && "