Skip to content

Commit

Permalink
fix: only plumb ip address on localhost on the first machine
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
  • Loading branch information
cprivitere committed Mar 14, 2024
1 parent 12e77fa commit 4ee51b4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions templates/cluster-template-emlb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,11 @@ spec:
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
sed -i "s,sandbox_image.*$,sandbox_image = \"$(kubeadm config images list | grep pause | sort -r | head -n1)\"," /etc/containerd/config.toml
systemctl restart containerd
ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
ip addr add {{ .controlPlaneEndpoint }} dev lo
fi
postKubeadmCommands:
- |
cat <<EOF >> /etc/network/interfaces
auto lo:0
iface lo:0 inet static
address {{ .controlPlaneEndpoint }}
netmask 255.255.255.255
EOF
systemctl restart networking
mkdir -p $HOME/.kube
cp /etc/kubernetes/admin.conf $HOME/.kube/config
echo "source <(kubectl completion bash)" >> $HOME/.bashrc
Expand Down

0 comments on commit 4ee51b4

Please sign in to comment.