integ/kubernetes/kubernetes-1.21.8/centos/files
Jim Gauld 169a0c0ee3 Move k8s container cleanup to containerd service
This introduces k8s-container-cleanup script that will be called
when containerd.service is stopped. The script detects whether systemd
state is 'stopping' due to shutdown/reboot, then stops all running
containers before the service shuts down.

During shutdown/reboot, some containers are not receiving the
SIGTERM signal. This leads to unexpected behaviour such as
generating huge coredumps.

There is an upstream issue regarding this:
https://github.com/kubernetes/kubernetes/issues/107158
The problem seems to be systemd related but this commit
addresses the problem with a workaround.

This reverts commit f3c18b0f79.
The k8s-container-cleanup script is moved from kubelet.service
to containerd.service. The ExecStopPost that calls this script
is removed, and replaced with ExecStop in containerd.service
to call the script (in config-files repo).

The k8s-container-cleanup script requires containerd is running
in order to use crictl utility. The shutdown of kubelet and
containerd have unpredictable timing, so the cleanup must be done
in containerd.

Test Plan: On AIO-SX
PASS: Verify k8s-container-cleanup logs to daemon.log during 'stopping.
PASS: Manual change containerd/kubelet shutdown timing and verify.
k8s-container-cleanup running to completion before containerd stopped.
PASS: Reboot and verify k8s-container-cleanup running to completion.
PASS: Lock/unlock and verify k8s-container-cleanup running to completion.
PASS: Manually run spellintian tool against k8s-container-cleanup.sh.
PASS: Manually run shellcheck tool against k8s-container-cleanup.sh.
PASS: Zuul tox bashate tool against k8s-container-cleanup.sh.

Partial-Bug: 1964111
Change-Id: Ic8a9e257f861ae218a8520205eced3eaa580dd20
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
2022-04-12 13:52:40 -04:00
..
Change-log-level-to-Debug.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
Revert-use-subpath-for-coredns-only-for-default-repo.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
enable-support-for-kubernetes-to-ignore-isolcpus.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
genmanpages.sh Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
kubeadm-create-platform-pods-with-zero-CPU-resources.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
kubeadm.conf Move k8s container cleanup to containerd service 2022-04-12 13:52:40 -04:00
kubelet-cgroup-setup.sh Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
kubelet-cpumanager-disable-CFS-quota-throttling-for-.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
kubelet-cpumanager-infrastructure-pods-use-system-re.patch Add metrics-server to list of platform namespaces 2022-03-10 12:04:30 -05:00
kubelet-cpumanager-introduce-concept-of-isolated-CPU.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
kubelet-cpumanager-keep-normal-containers-off-reserv.patch Replace K8s 1.21.3 with 1.21.8 2022-01-14 16:57:25 -05:00
kubelet-sort-isolcpus-allocation-when-SMT-enabled.patch kubelet: sort isolcpus allocation when SMT enabled 2022-02-11 12:21:20 -05:00
kubernetes-make-isolcpus-allocation-SMT-aware.patch kubernetes: make isolcpus allocation SMT-aware 2022-02-10 14:32:14 -05:00