From 0369c47835fe9e2a36c3c72b27f1126d8391579a Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 17 Feb 2021 11:29:11 -0500 Subject: [PATCH] templates: add After=ostree-finalize-staged.service to kubelet.service We've seen occasional issues during upgrades caused by what seems to be the kubelet still being active during OSTree finalization. If the kubelet changes things in `/etc`, it'll confuse OSTree which is trying to do the `/etc` merge. We want to be sure that the kubelet is done modifying everything it needs to in `/etc` and that it exited before we finalize the deployment. Add a `After=ostree-finalize-staged.service` for this. The way this works is that that service runs in its `ExecStop`, and shutdown ordering is the reverse of startup. So this will cause the kubelet to exit before `ostree-finalize-staged.service` is stopped. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1902963 --- .../master/01-master-kubelet/_base/units/kubelet.service.yaml | 1 + .../master/01-master-kubelet/on-prem/units/kubelet.service.yaml | 1 + .../worker/01-worker-kubelet/_base/units/kubelet.service.yaml | 1 + .../worker/01-worker-kubelet/on-prem/units/kubelet.service.yaml | 1 + 4 files changed, 4 insertions(+) diff --git a/templates/master/01-master-kubelet/_base/units/kubelet.service.yaml b/templates/master/01-master-kubelet/_base/units/kubelet.service.yaml index 815a0b5a8b..fab5f3b441 100644 --- a/templates/master/01-master-kubelet/_base/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/_base/units/kubelet.service.yaml @@ -5,6 +5,7 @@ contents: | Description=Kubernetes Kubelet Wants=rpc-statd.service network-online.target crio.service After=network-online.target crio.service + After=ostree-finalize-staged.service [Service] Type=notify diff --git a/templates/master/01-master-kubelet/on-prem/units/kubelet.service.yaml b/templates/master/01-master-kubelet/on-prem/units/kubelet.service.yaml index 2df3e16b9e..fe8d72d42c 100644 --- a/templates/master/01-master-kubelet/on-prem/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/on-prem/units/kubelet.service.yaml @@ -5,6 +5,7 @@ contents: | Description=Kubernetes Kubelet Wants=rpc-statd.service network-online.target crio.service After=network-online.target crio.service + After=ostree-finalize-staged.service [Service] Type=notify diff --git a/templates/worker/01-worker-kubelet/_base/units/kubelet.service.yaml b/templates/worker/01-worker-kubelet/_base/units/kubelet.service.yaml index d0b72348f9..35a9f0bd69 100644 --- a/templates/worker/01-worker-kubelet/_base/units/kubelet.service.yaml +++ b/templates/worker/01-worker-kubelet/_base/units/kubelet.service.yaml @@ -5,6 +5,7 @@ contents: | Description=Kubernetes Kubelet Wants=rpc-statd.service network-online.target crio.service After=network-online.target crio.service + After=ostree-finalize-staged.service [Service] Type=notify diff --git a/templates/worker/01-worker-kubelet/on-prem/units/kubelet.service.yaml b/templates/worker/01-worker-kubelet/on-prem/units/kubelet.service.yaml index 5e034e2508..54ec4a97aa 100644 --- a/templates/worker/01-worker-kubelet/on-prem/units/kubelet.service.yaml +++ b/templates/worker/01-worker-kubelet/on-prem/units/kubelet.service.yaml @@ -5,6 +5,7 @@ contents: | Description=Kubernetes Kubelet Wants=rpc-statd.service network-online.target crio.service After=network-online.target crio.service + After=ostree-finalize-staged.service [Service] Type=notify