gardener / gardener-extension-os-gardenlinux

Gardener extension controller for the Garden Linux operating system
Apache License 2.0
9 stars 31 forks source link

fix: improve check for running kubelet.service #126

Closed MrBatschner closed 11 months ago

MrBatschner commented 1 year ago

How to categorize this PR?

/area os /kind bug /os garden-linux

What this PR does / why we need it:

The logic introduced in PR #85 that is meant to restart a running kubelet if containerd's cgroup driver gets updated to make kubelet pick up that change as well is using systemctl is-active kubelet.service to determine if kubelet is running or not. If the kubelets systemd unit is either active or reloading, systemctl will return with 0 and thus, kubelet gets restarted. However, there is another status that may require a kubelet restart: activating. Unfortunately this status produces return code 3 and leads to the kubelet not getting restarted even though that would be absolutely necessary. This situation can lead to a race which leads to the problems described in issue #98.

Which issue(s) this PR fixes: Fixes #98

Release note:

A condition that may lead to containerd and kubelet use different cgroup drivers in rare cases was fixed.
danielfoehrKn commented 11 months ago

Superseded by this PR