Skip to content

Commit 3e53a22

Browse files
committed
fix: only plumb ip address on localhost on the first machine
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
1 parent 08b9879 commit 3e53a22

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

templates/cluster-template-emlb.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,11 @@ spec:
7575
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
7676
sed -i "s,sandbox_image.*$,sandbox_image = \"$(kubeadm config images list | grep pause | sort -r | head -n1)\"," /etc/containerd/config.toml
7777
systemctl restart containerd
78-
ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo
78+
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
79+
ip addr add {{ .controlPlaneEndpoint }} dev lo
80+
fi
7981
postKubeadmCommands:
8082
- |
81-
cat <<EOF >> /etc/network/interfaces
82-
auto lo:0
83-
iface lo:0 inet static
84-
address {{ .controlPlaneEndpoint }}
85-
netmask 255.255.255.255
86-
EOF
87-
systemctl restart networking
8883
mkdir -p $HOME/.kube
8984
cp /etc/kubernetes/admin.conf $HOME/.kube/config
9085
echo "source <(kubectl completion bash)" >> $HOME/.bashrc

0 commit comments

Comments
 (0)