From d266aa25955690877638feb87cd9c3093208bac1 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 + .../01-master-kubelet/baremetal/units/kubelet.service.yaml | 1 + .../worker/01-worker-kubelet/_base/units/kubelet.service.yaml | 1 + .../01-worker-kubelet/baremetal/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 52825e5a36..d9e339db0c 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/baremetal/units/kubelet.service.yaml b/templates/master/01-master-kubelet/baremetal/units/kubelet.service.yaml index 726075348b..f7816c6de9 100644 --- a/templates/master/01-master-kubelet/baremetal/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/baremetal/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 d060c09fab..fec208b11a 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/baremetal/units/kubelet.service.yaml b/templates/worker/01-worker-kubelet/baremetal/units/kubelet.service.yaml index 00375bc825..b794b5b726 100644 --- a/templates/worker/01-worker-kubelet/baremetal/units/kubelet.service.yaml +++ b/templates/worker/01-worker-kubelet/baremetal/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