[k8s] Fix instance ID issue with podman and autoscaler

Adding the volume mount for /etc/machine-id so that the kubelet
boostraped by podman can access the correct instance ID. Without
this, autoscaler will fail to delete empty node. This issue is
reported on autoscaler repo[1].

[1] https://github.com/kubernetes/autoscaler/issues/2819

Task: 38743
Story: 2007286

Change-Id: I2852f4b255e782bb65b13571502194ee9f455ae3
(cherry picked from commit eb2b688f3e)
This commit is contained in:
Feilong Wang 2020-02-12 21:37:51 +13:00 committed by Bharat Kunwar
parent a75d8be424
commit 7e89ac65a4
2 changed files with 2 additions and 0 deletions

View File

@ -201,6 +201,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
--volume /var/run:/var/run \\
--volume /var/run/lock:/var/run/lock:z \\
--volume /opt/cni/bin:/opt/cni/bin:z \\
--volume /etc/machine-id:/etc/machine-id \\
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
kubelet \\
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBELET_API_SERVER \$KUBELET_ADDRESS \$KUBELET_PORT \$KUBELET_HOSTNAME \$KUBELET_ARGS'

View File

@ -98,6 +98,7 @@ ExecStart=/bin/bash -c '/usr/bin/podman run --name kubelet \\
--volume /var/run:/var/run \\
--volume /var/run/lock:/var/run/lock:z \\
--volume /opt/cni/bin:/opt/cni/bin:z \\
--volume /etc/machine-id:/etc/machine-id \\
\${CONTAINER_INFRA_PREFIX:-k8s.gcr.io/}hyperkube:\${KUBE_TAG} \\
kubelet \\
\$KUBE_LOGTOSTDERR \$KUBE_LOG_LEVEL \$KUBELET_API_SERVER \$KUBELET_ADDRESS \$KUBELET_PORT \$KUBELET_HOSTNAME \$KUBELET_ARGS'