mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 11:00:25 +00:00
Merge pull request #2552 from ijc/kubernetes
kubernetes: do not try to re-init the cluster on subsequent boots
This commit is contained in:
commit
2aaf29eefa
@ -36,7 +36,7 @@ services:
|
||||
- name: sshd
|
||||
image: linuxkit/sshd:d313eea3d9d7fbcbc927d06a6700325725db2a82
|
||||
- name: kubelet
|
||||
image: linuxkitprojects/kubernetes:710738dd5a75bb06a1a5a88c74df136ea05bc8a5
|
||||
image: linuxkitprojects/kubernetes:807de925610de344864cadd21b9860342a5c2bda
|
||||
files:
|
||||
- path: etc/linuxkit.yml
|
||||
metadata: yaml
|
||||
|
@ -10,7 +10,12 @@ fi
|
||||
if [ -e /etc/kubelet.sh.conf ] ; then
|
||||
. /etc/kubelet.sh.conf
|
||||
fi
|
||||
if [ -e /var/config/kubeadm/init ] ; then
|
||||
|
||||
conf=/var/lib/kubeadm/kubelet.conf
|
||||
|
||||
if [ -f "${conf}" ] ; then
|
||||
echo "kubelet.sh: kubelet already configured"
|
||||
elif [ -e /var/config/kubeadm/init ] ; then
|
||||
echo "kubelet.sh: init cluster with metadata \"$(cat /var/config/kubeadm/init)\""
|
||||
# This needs to be in the background since it waits for kubelet to start.
|
||||
# We skip printing the token so it is not persisted in the log.
|
||||
@ -23,8 +28,6 @@ elif [ -e /var/config/userdata ] ; then
|
||||
kubeadm join --skip-preflight-checks $(cat /var/config/userdata)
|
||||
fi
|
||||
|
||||
conf=/var/lib/kubeadm/kubelet.conf
|
||||
|
||||
echo "kubelet.sh: waiting for ${conf}"
|
||||
# TODO(ijc) is there a race between kubeadm creating this file and
|
||||
# finishing the write where we might be able to fall through and
|
||||
|
Loading…
Reference in New Issue
Block a user