diff --git a/templates/cluster-template-crs-cni.yaml b/templates/cluster-template-crs-cni.yaml index 2e90299db..c1dda29f0 100644 --- a/templates/cluster-template-crs-cni.yaml +++ b/templates/cluster-template-crs-cni.yaml @@ -143,7 +143,6 @@ spec: address {{ .controlPlaneEndpoint }} netmask 255.255.255.255 EOF - systemctl restart networking if [ -f "/run/kubeadm/kubeadm.yaml" ]; then export KUBECONFIG=/etc/kubernetes/admin.conf export CPEM_YAML=https://github.com/equinix/cloud-provider-equinix-metal/releases/download/v3.4.0/deployment.yaml @@ -176,11 +175,6 @@ spec: TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//') RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1) DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION} - curl -o /run/metadata.json -fsSL https://metadata.platformequinix.com/metadata - for i in $(cat /run/metadata.json | jq -r '.bgp_neighbors[0].peer_ips[]'); do - ip route add $i via $(cat /run/metadata.json | jq -r '.network.addresses[] | select(.public == false and .address_family == 4) | .gateway') - done - rm /run/metadata.json ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo machineTemplate: infrastructureRef: diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index d9dee6c22..c915d30ab 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -55,11 +55,6 @@ spec: TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//') RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1) DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION} - curl -o /run/metadata.json -fsSL https://metadata.platformequinix.com/metadata - for i in $(cat /run/metadata.json | jq -r '.bgp_neighbors[0].peer_ips[]'); do - ip route add $i via $(cat /run/metadata.json | jq -r '.network.addresses[] | select(.public == false and .address_family == 4) | .gateway') - done - rm /run/metadata.json ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo postKubeadmCommands: - | @@ -69,7 +64,6 @@ spec: address {{ .controlPlaneEndpoint }} netmask 255.255.255.255 EOF - systemctl restart networking if [ -f "/run/kubeadm/kubeadm.yaml" ]; then export KUBECONFIG=/etc/kubernetes/admin.conf export CPEM_YAML=https://github.com/equinix/cloud-provider-equinix-metal/releases/download/v3.4.0/deployment.yaml