@@ -40,20 +40,31 @@ spec:
40
40
- sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
41
41
- swapoff -a
42
42
- mount -a
43
+ - |
44
+ cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
45
+ overlay
46
+ br_netfilter
47
+ EOF
48
+ - modprobe overlay
49
+ - modprobe br_netfilter
50
+ - |
51
+ cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
52
+ net.bridge.bridge-nf-call-iptables = 1
53
+ net.ipv4.ip_forward = 1
54
+ net.bridge.bridge-nf-call-ip6tables = 1
55
+ EOF
56
+ - sysctl --system
43
57
- apt-get -y update
44
58
- DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl
45
59
- curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
46
60
- echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
47
- - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
48
- - apt-key fingerprint 0EBFCD88
49
- - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
50
61
- apt-get update -y
51
62
- TRIMMED_KUBERNETES_VERSION=$(echo ${KUBERNETES_VERSION} | sed 's/\./\\./g' | sed 's/^v//')
52
63
- RESOLVED_KUBERNETES_VERSION=$(apt-cache policy kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$1~ VERSION { print $1 }' | head -n1)
53
- - apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips docker-ce docker-ce-cli containerd.io kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
64
+ - apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
54
65
- systemctl daemon-reload
55
- - systemctl enable docker
56
- - systemctl start docker
66
+ - systemctl enable containerd
67
+ - systemctl start containerd
57
68
- ping -c 3 -q {{ .controlPlaneEndpoint }} && echo OK || ip addr add {{ .controlPlaneEndpoint }} dev lo
58
69
---
59
70
apiVersion : infrastructure.cluster.x-k8s.io/v1alpha3
@@ -156,20 +167,31 @@ spec:
156
167
- sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab
157
168
- swapoff -a
158
169
- mount -a
170
+ - |
171
+ cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
172
+ overlay
173
+ br_netfilter
174
+ EOF
175
+ - modprobe overlay
176
+ - modprobe br_netfilter
177
+ - |
178
+ cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
179
+ net.bridge.bridge-nf-call-iptables = 1
180
+ net.ipv4.ip_forward = 1
181
+ net.bridge.bridge-nf-call-ip6tables = 1
182
+ EOF
183
+ - sysctl --system
159
184
- apt-get -y update
160
185
- DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl
161
186
- curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
162
187
- echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
163
- - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
164
- - apt-key fingerprint 0EBFCD88
165
- - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
166
188
- apt-get update -y
167
189
- TRIMMED_KUBERNETES_VERSION=$(echo ${KUBERNETES_VERSION} | sed 's/\./\\./g' | sed 's/^v//')
168
190
- RESOLVED_KUBERNETES_VERSION=$(apt-cache policy kubelet | awk -v VERSION=$${TRIMMED_KUBERNETES_VERSION} '$1~ VERSION { print $1 }' | head -n1)
169
- - apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips docker-ce docker-ce-cli containerd.io kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
191
+ - apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips containerd kubelet=$${RESOLVED_KUBERNETES_VERSION} kubeadm=$${RESOLVED_KUBERNETES_VERSION} kubectl=$${RESOLVED_KUBERNETES_VERSION}
170
192
- systemctl daemon-reload
171
- - systemctl enable docker
172
- - systemctl start docker
193
+ - systemctl enable containerd
194
+ - systemctl start containerd
173
195
joinConfiguration :
174
196
nodeRegistration :
175
197
kubeletExtraArgs :
0 commit comments