Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 8c1784e

Browse files
authored
Merge pull request #405 from cprivitere/cprivitere/issue403
✨ Set up default environment for kubectl, crictl, etc.
2 parents ed51d7b + e4fe292 commit 8c1784e

File tree

6 files changed

+226
-65
lines changed

6 files changed

+226
-65
lines changed

templates/cluster-template-crs-cni.yaml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
cloud-provider: external
3131
provider-id: equinixmetal://{{ `{{ v1.instance_id }}` }}
3232
preKubeadmCommands:
33-
- |
33+
- |-
3434
sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
3535
swapoff -a
3636
mount -a
@@ -46,14 +46,27 @@ spec:
4646
net.bridge.bridge-nf-call-ip6tables = 1
4747
EOF
4848
sysctl --system
49-
apt-get -y update
50-
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
51-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
52-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
49+
export DEBIAN_FRONTEND=noninteractive
50+
apt-get update -y
51+
apt-get remove -y docker docker-engine docker.io containerd runc
52+
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
53+
mkdir -p /etc/apt/keyrings
54+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
55+
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
56+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
57+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
5358
apt-get update -y
5459
TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//')
55-
RESOLVED_KUBERNETES_VERSION=$(apt-cache policy kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$1~ VERSION { print $1 }' | head -n1)
56-
DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
60+
RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1)
61+
apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
62+
cat <<EOF > /etc/crictl.yaml
63+
runtime-endpoint: unix:///run/containerd/containerd.sock
64+
image-endpoint: unix:///run/containerd/containerd.sock
65+
EOF
66+
containerd config default > /etc/containerd/config.toml
67+
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
68+
sed -i "s,sandbox_image.*$,sandbox_image = $(kubeadm config images list | grep pause | sort -r | head -n1)," /etc/containerd/config.toml
69+
systemctl restart containerd
5770
---
5871
apiVersion: cluster.x-k8s.io/v1beta1
5972
kind: Cluster
@@ -146,6 +159,10 @@ spec:
146159
systemctl restart networking
147160
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
148161
export KUBECONFIG=/etc/kubernetes/admin.conf
162+
mkdir -p /root/.kube && cp -f $${KUBECONFIG} /root/.kube/config
163+
echo "source <(kubectl completion bash)" >> /root/.bashrc
164+
echo "alias k=kubectl" >> /root/.bashrc
165+
echo "complete -o default -F __start_kubectl k" >> /root/.bashrc
149166
export CPEM_YAML=https://github.com/equinix/cloud-provider-equinix-metal/releases/download/v3.5.0/deployment.yaml
150167
export SECRET_DATA='cloud-sa.json=''{"apiKey": "{{ .apiKey }}","projectID": "${PROJECT_ID}", "eipTag": "cluster-api-provider-packet:cluster-id:${CLUSTER_NAME}", "eipHealthCheckUseHostIP": true}'''
151168
kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}" || (sleep 1 && kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}") || (sleep 1 && kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}")
@@ -168,14 +185,31 @@ spec:
168185
net.bridge.bridge-nf-call-ip6tables = 1
169186
EOF
170187
sysctl --system
171-
apt-get -y update
172-
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
173-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
174-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
188+
export DEBIAN_FRONTEND=noninteractive
189+
apt-get update -y
190+
apt-get remove -y docker docker-engine docker.io containerd runc
191+
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
192+
major_vers=$(lsb_release -r | awk '{ print $2 }' | cut -d. -f1)
193+
if [[ "$major_vers" -ge 20 ]]; then
194+
apt-get install -y kubetail
195+
fi
196+
mkdir -p /etc/apt/keyrings
197+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
198+
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
199+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
200+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
175201
apt-get update -y
176202
TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//')
177203
RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1)
178-
DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
204+
apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
205+
containerd config default > /etc/containerd/config.toml
206+
cat <<EOF > /etc/crictl.yaml
207+
runtime-endpoint: unix:///run/containerd/containerd.sock
208+
image-endpoint: unix:///run/containerd/containerd.sock
209+
EOF
210+
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
211+
sed -i "s,sandbox_image.*$,sandbox_image = $(kubeadm config images list | grep pause | sort -r | head -n1)," /etc/containerd/config.toml
212+
systemctl restart containerd
179213
ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo
180214
machineTemplate:
181215
infrastructureRef:

templates/cluster-template-kube-vip-crs-cni.yaml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,27 @@ spec:
4646
net.bridge.bridge-nf-call-ip6tables = 1
4747
EOF
4848
sysctl --system
49-
apt-get -y update
50-
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
51-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
52-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
49+
export DEBIAN_FRONTEND=noninteractive
50+
apt-get update -y
51+
apt-get remove -y docker docker-engine docker.io containerd runc
52+
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
53+
mkdir -p /etc/apt/keyrings
54+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
55+
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
56+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
57+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
5358
apt-get update -y
5459
TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//')
5560
RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1)
56-
DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
61+
apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
62+
cat <<EOF > /etc/crictl.yaml
63+
runtime-endpoint: unix:///run/containerd/containerd.sock
64+
image-endpoint: unix:///run/containerd/containerd.sock
65+
EOF
66+
containerd config default > /etc/containerd/config.toml
67+
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
68+
sed -i "s,sandbox_image.*$,sandbox_image = $(kubeadm config images list | grep pause | sort -r | head -n1)," /etc/containerd/config.toml
69+
systemctl restart containerd
5770
---
5871
apiVersion: cluster.x-k8s.io/v1beta1
5972
kind: Cluster
@@ -139,6 +152,10 @@ spec:
139152
- |-
140153
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
141154
export KUBECONFIG=/etc/kubernetes/admin.conf
155+
mkdir -p /root/.kube && cp -f $${KUBECONFIG} /root/.kube/config
156+
echo "source <(kubectl completion bash)" >> /root/.bashrc
157+
echo "alias k=kubectl" >> /root/.bashrc
158+
echo "complete -o default -F __start_kubectl k" >> /root/.bashrc
142159
export CPEM_YAML=https://github.com/equinix/cloud-provider-equinix-metal/releases/download/v3.5.0/deployment.yaml
143160
export SECRET_DATA='cloud-sa.json=''{"apiKey": "{{ .apiKey }}","projectID": "${PROJECT_ID}", "loadbalancer": "kube-vip://", "facility": "${FACILITY}"}'''
144161
kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}" || (sleep 1 && kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}") || (sleep 1 && kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}")
@@ -161,14 +178,28 @@ spec:
161178
net.bridge.bridge-nf-call-ip6tables = 1
162179
EOF
163180
sysctl --system
164-
apt-get -y update
165-
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
166-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
167-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
181+
export DEBIAN_FRONTEND=noninteractive
182+
apt-get update -y
183+
apt-get remove -y docker docker-engine docker.io containerd runc
184+
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
185+
mkdir -p /etc/apt/keyrings
186+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
187+
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
188+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
189+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
168190
apt-get update -y
169191
TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//')
170192
RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1)
171-
DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
193+
apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
194+
cat <<EOF > /etc/crictl.yaml
195+
runtime-endpoint: unix:///run/containerd/containerd.sock
196+
image-endpoint: unix:///run/containerd/containerd.sock
197+
EOF
198+
containerd config default > /etc/containerd/config.toml
199+
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
200+
sed -i "s,sandbox_image.*$,sandbox_image = $(kubeadm config images list | grep pause | sort -r | head -n1)," /etc/containerd/config.toml
201+
systemctl restart containerd
202+
ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo
172203
curl -o /run/metadata.json -fsSL https://metadata.platformequinix.com/metadata
173204
for i in $(cat /run/metadata.json | jq -r '.bgp_neighbors[0].peer_ips[]'); do
174205
ip route add $i via $(cat /run/metadata.json | jq -r '.network.addresses[] | select(.public == false and .address_family == 4) | .gateway')

templates/cluster-template-kube-vip.yaml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,27 @@ spec:
2727
net.bridge.bridge-nf-call-ip6tables = 1
2828
EOF
2929
sysctl --system
30-
apt-get -y update
31-
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
32-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
33-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
30+
export DEBIAN_FRONTEND=noninteractive
31+
apt-get update -y
32+
apt-get remove -y docker docker-engine docker.io containerd runc
33+
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
34+
mkdir -p /etc/apt/keyrings
35+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
36+
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
37+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
38+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
3439
apt-get update -y
3540
TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//')
3641
RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1)
37-
DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
42+
apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
43+
cat <<EOF > /etc/crictl.yaml
44+
runtime-endpoint: unix:///run/containerd/containerd.sock
45+
image-endpoint: unix:///run/containerd/containerd.sock
46+
EOF
47+
containerd config default > /etc/containerd/config.toml
48+
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
49+
sed -i "s,sandbox_image.*$,sandbox_image = $(kubeadm config images list | grep pause | sort -r | head -n1)," /etc/containerd/config.toml
50+
systemctl restart containerd
3851
---
3952
apiVersion: cluster.x-k8s.io/v1beta1
4053
kind: Cluster
@@ -118,6 +131,10 @@ spec:
118131
- |-
119132
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
120133
export KUBECONFIG=/etc/kubernetes/admin.conf
134+
mkdir -p /root/.kube && cp -f $${KUBECONFIG} /root/.kube/config
135+
echo "source <(kubectl completion bash)" >> /root/.bashrc
136+
echo "alias k=kubectl" >> /root/.bashrc
137+
echo "complete -o default -F __start_kubectl k" >> /root/.bashrc
121138
export CPEM_YAML=https://github.com/equinix/cloud-provider-equinix-metal/releases/download/v3.5.0/deployment.yaml
122139
export SECRET_DATA='cloud-sa.json=''{"apiKey": "{{ .apiKey }}","projectID": "${PROJECT_ID}", "loadbalancer": "kube-vip://", "facility": "${FACILITY}"}'''
123140
kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}" || (sleep 1 && kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}") || (sleep 1 && kubectl create secret generic -n kube-system metal-cloud-config --from-literal="$${SECRET_DATA}")
@@ -140,14 +157,28 @@ spec:
140157
net.bridge.bridge-nf-call-ip6tables = 1
141158
EOF
142159
sysctl --system
143-
apt-get -y update
144-
DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
145-
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
146-
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
160+
export DEBIAN_FRONTEND=noninteractive
161+
apt-get update -y
162+
apt-get remove -y docker docker-engine docker.io containerd runc
163+
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release linux-generic jq
164+
mkdir -p /etc/apt/keyrings
165+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
166+
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
167+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
168+
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
147169
apt-get update -y
148170
TRIMMED_KUBERNETES_VERSION=$(echo {{ .kubernetesVersion }} | sed 's/\./\\\\./g' | sed 's/^v//')
149171
RESOLVED_KUBERNETES_VERSION=$(apt-cache madison kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$3~ VERSION { print $3 }' | head -n1)
150-
DEBIAN_FRONTEND=noninteractive apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
172+
apt-get install -y containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
173+
cat <<EOF > /etc/crictl.yaml
174+
runtime-endpoint: unix:///run/containerd/containerd.sock
175+
image-endpoint: unix:///run/containerd/containerd.sock
176+
EOF
177+
containerd config default > /etc/containerd/config.toml
178+
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
179+
sed -i "s,sandbox_image.*$,sandbox_image = $(kubeadm config images list | grep pause | sort -r | head -n1)," /etc/containerd/config.toml
180+
systemctl restart containerd
181+
ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo
151182
curl -o /run/metadata.json -fsSL https://metadata.platformequinix.com/metadata
152183
for i in $(cat /run/metadata.json | jq -r '.bgp_neighbors[0].peer_ips[]'); do
153184
ip route add $i via $(cat /run/metadata.json | jq -r '.network.addresses[] | select(.public == false and .address_family == 4) | .gateway')

0 commit comments

Comments
 (0)