sed -i 's/endpoint = \["https:\/\/registry-1\.docker\.io"\]/endpoint = {{ append .dockerRegistryMirrors "https://registry-1.docker.io" | toJson | replace "/" "\\/" | replace "[" "\\[" | replace "]" "\\]" }}/' /etc/containerd/config.toml
{{- end }}
systemctl restart containerd
-{{- else if eq .containerRuntime "docker" -}}
-- path: /usr/local/bin/install-container-runtime.sh
- permissions: '0777'
- content: |
- #!/usr/bin/env bash
- set -eux -o pipefail
- apt-get install -y docker-ce={{ .dockerVersion }} docker-ce-cli={{ .dockerVersion }} containerd.io={{ .containerdVersion }}
- systemctl enable --now docker
- usermod -aG docker ubuntu
-- path: /etc/docker/daemon.json
- content: |
- {
- "exec-opts": ["native.cgroupdriver=systemd"],
- "log-driver": "json-file",
- "log-opts": {
- "max-size": "100m"
- },
-{{- if .dockerRegistryMirrors }}
- "registry-mirrors": {{ .dockerRegistryMirrors | toJson }}
-{{- end }}
- "storage-driver": "overlay2"
- }
-{{- end }}
{{- end }}
+{{- end }}
\ No newline at end of file
# -----BEGIN PGP PRIVATE KEY BLOCK-----
# ...
-# containerRuntime may be containerd or docker.
+# containerRuntime may be containerd.
containerRuntime: containerd
# ipam may be ipv4, dualstack, or ipv6. This configures IP address
# cni is the cluster CNI. Supported CNIs include calico and flannel.
cni: calico
-# All the version info is captured in one block here. Care must
-# be taken to ensure that the OS, Kubernetes, and CRI (containerd
-# or docker) versions are all compatible.
+# All the version info is captured in one block here. Care must be
+# taken to ensure that the OS, Kubernetes, and CRI versions are all
+# compatible.
#
# Refer to the below for further information:
# - https://github.com/kubernetes/kubernetes/blob/master/build/dependencies.yaml
kubeVersion: 1.21.6-00
# containerd is the version of containerd installed.
containerdVersion: 1.4.11-1
-# dockerVersion is the version of docker installed.
-dockerVersion: 5:20.10.10~3-0~ubuntu-focal
# dockerRegistryMirrors are optional mirrors for docker.io, in priority order
#dockerRegistryMirrors: ["https://myregistry.com:5000"]
# preKubeadmCommands execute on the provisioned machine before the