diff --git a/templates/common/_base/units/crio.service.yaml b/templates/common/_base/units/crio.service.yaml index 13d11f6f5f..30f557ee12 100644 --- a/templates/common/_base/units/crio.service.yaml +++ b/templates/common/_base/units/crio.service.yaml @@ -1,5 +1,10 @@ name: crio.service dropins: + - name: 05-mco-ordering.conf + contents: | + [Unit] + After=kubelet-dependencies.target + Requires=kubelet-dependencies.target - name: 10-mco-default-madv.conf contents: | [Service] diff --git a/templates/common/_base/units/kubelet-auto-node-size.service.yaml b/templates/common/_base/units/kubelet-auto-node-size.service.yaml index 96485f4390..b43868956c 100644 --- a/templates/common/_base/units/kubelet-auto-node-size.service.yaml +++ b/templates/common/_base/units/kubelet-auto-node-size.service.yaml @@ -5,7 +5,6 @@ contents: | Description=Dynamically sets the system reserved for the kubelet Wants=network-online.target After=network-online.target ignition-firstboot-complete.service - Before=kubelet.service crio.service [Service] # Need oneshot to delay kubelet Type=oneshot @@ -13,4 +12,4 @@ contents: | EnvironmentFile=/etc/node-sizing-enabled.env ExecStart=/bin/bash /usr/local/sbin/dynamic-system-reserved-calc.sh ${NODE_SIZING_ENABLED} ${SYSTEM_RESERVED_MEMORY} ${SYSTEM_RESERVED_CPU} ${SYSTEM_RESERVED_ES} [Install] - RequiredBy=kubelet.service + RequiredBy=kubelet-dependencies.target diff --git a/templates/common/_base/units/kubelet-dependencies.target.yaml b/templates/common/_base/units/kubelet-dependencies.target.yaml new file mode 100644 index 0000000000..dcfe2f7dbb --- /dev/null +++ b/templates/common/_base/units/kubelet-dependencies.target.yaml @@ -0,0 +1,8 @@ +name: kubelet-dependencies.target +contents: | + [Unit] + Description=Dependencies necessary to run kubelet + Documentation=https://github.com/openshift/machine-config-operator/ + Requires=basic.target network-online.target + Wants=NetworkManager-wait-online.service crio-wipe.service + Wants=rpc-statd.service 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 b2d19265bd..aeae85eb3f 100644 --- a/templates/master/01-master-kubelet/_base/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/_base/units/kubelet.service.yaml @@ -3,9 +3,8 @@ enabled: true contents: | [Unit] Description=Kubernetes Kubelet - Wants=rpc-statd.service network-online.target - Requires=crio.service kubelet-auto-node-size.service - After=network-online.target crio.service kubelet-auto-node-size.service + Requires=crio.service kubelet-dependencies.target + After=kubelet-dependencies.target After=ostree-finalize-staged.service [Service] diff --git a/templates/master/01-master-kubelet/alibabacloud/units/kubelet.service.yaml b/templates/master/01-master-kubelet/alibabacloud/units/kubelet.service.yaml index 176fa59db0..c5395c1211 100644 --- a/templates/master/01-master-kubelet/alibabacloud/units/kubelet.service.yaml +++ b/templates/master/01-master-kubelet/alibabacloud/units/kubelet.service.yaml @@ -3,9 +3,8 @@ enabled: true contents: | [Unit] Description=Kubernetes Kubelet - Wants=rpc-statd.service network-online.target - Requires=crio.service kubelet-auto-node-size.service - After=network-online.target crio.service kubelet-auto-node-size.service + Requires=crio.service kubelet-dependencies.target + After=kubelet-dependencies.target After=ostree-finalize-staged.service [Service] 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 4380f1bc14..9651b623ad 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 @@ -3,9 +3,8 @@ enabled: true contents: | [Unit] Description=Kubernetes Kubelet - Wants=rpc-statd.service network-online.target - Requires=crio.service kubelet-auto-node-size.service - After=network-online.target crio.service kubelet-auto-node-size.service + Requires=crio.service kubelet-dependencies.target + After=kubelet-dependencies.target After=ostree-finalize-staged.service [Service] 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 4a807df93d..e1fb230f71 100644 --- a/templates/worker/01-worker-kubelet/_base/units/kubelet.service.yaml +++ b/templates/worker/01-worker-kubelet/_base/units/kubelet.service.yaml @@ -3,9 +3,8 @@ enabled: true contents: | [Unit] Description=Kubernetes Kubelet - Wants=rpc-statd.service network-online.target - Requires=crio.service kubelet-auto-node-size.service - After=network-online.target crio.service kubelet-auto-node-size.service + Requires=crio.service kubelet-dependencies.target + After=kubelet-dependencies.target After=ostree-finalize-staged.service [Service] diff --git a/templates/worker/01-worker-kubelet/alibabacloud/units/kubelet.service.yaml b/templates/worker/01-worker-kubelet/alibabacloud/units/kubelet.service.yaml index 8b8c60f7f0..2f638cac0f 100644 --- a/templates/worker/01-worker-kubelet/alibabacloud/units/kubelet.service.yaml +++ b/templates/worker/01-worker-kubelet/alibabacloud/units/kubelet.service.yaml @@ -3,9 +3,8 @@ enabled: true contents: | [Unit] Description=Kubernetes Kubelet - Wants=rpc-statd.service network-online.target - Requires=crio.service kubelet-auto-node-size.service - After=network-online.target crio.service kubelet-auto-node-size.service + Requires=crio.service kubelet-dependencies.target + After=kubelet-dependencies.target After=ostree-finalize-staged.service [Service] 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 f1bc2680c3..eb8cde3e4d 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 @@ -3,9 +3,8 @@ enabled: true contents: | [Unit] Description=Kubernetes Kubelet - Wants=rpc-statd.service network-online.target - Requires=crio.service kubelet-auto-node-size.service - After=network-online.target crio.service kubelet-auto-node-size.service + Requires=crio.service kubelet-dependencies.target + After=kubelet-dependencies.target After=ostree-finalize-staged.service [Service]