Skip to content

Commit ed3bfad

Browse files
daleeswaipeng
authored andcommitted
Fix pods stuck terminating.
If the kubelet container is restarted on a host (during upgrades, or manually) the bind mounts duplicate into /rootfs and kubelet cannot unmount these. This leads to stuck terminating pods that must be resolved with either --force or restart of kubelet container. Adding 'rslave' means that when the kubelet unmounts volumes at /var/lib/kubelet/pods this propogates to the host (using 'rshared'), and back into the container in /rootfs. This bug was likely introduced when mounting of /rootfs was added[0]. [0] https://opendev.org/openstack/magnum/commit/1994e9448a4d131e6305b68e49f1fdcdb5420cef Change-Id: I44f80ccc97c0eeab98f1edbe4a22763732b7f4da (cherry picked from commit b318560) (cherry picked from commit ed63a0d626b030f7d5fa81fe3341b7e8d8ef4a2b)
1 parent b8e50f2 commit ed3bfad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
187187
--pid host \\
188188
--network host \\
189189
--entrypoint /hyperkube \\
190-
--volume /:/rootfs:ro \\
190+
--volume /:/rootfs:rslave,ro \\
191191
--volume /etc/cni/net.d:/etc/cni/net.d:ro,z \\
192192
--volume /etc/kubernetes:/etc/kubernetes:ro,z \\
193193
--volume /usr/lib/os-release:/usr/lib/os-release:ro \\

magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
8585
--pid host \\
8686
--network host \\
8787
--entrypoint /hyperkube \\
88-
--volume /:/rootfs:ro \\
88+
--volume /:/rootfs:rslave,ro \\
8989
--volume /etc/cni/net.d:/etc/cni/net.d:ro,z \\
9090
--volume /etc/kubernetes:/etc/kubernetes:ro,z \\
9191
--volume /usr/lib/os-release:/usr/lib/os-release:ro \\

0 commit comments

Comments
 (0)