Feel free to swap Docker with another CRI (Container Runtime Interface) e.g. CRI-O, containerd
sudo apt update && sudo apt install -y apt-transport-https curl ca-certificates software-properties-common
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo add-apt-repository \
"deb https://apt.kubernetes.io/ kubernetes-xenial main"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo swapoff -a && sudo sed -i '/ swap / s/^/#/' /etc/fstab
The /etc/fstab
file should now be commented out for the swap mount point
sudo apt-get update && sudo apt-get install -y \
docker-ce=18.06.2~ce~3-0~ubuntu
sudo apt-mark hold docker-ce=18.06.2~ce~3-0~ubuntu
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo systemctl daemon-reload && sudo systemctl restart docker
sudo apt install -y kubelet=1.15.11-00 kubeadm=1.15.11-00 kubectl=1.15.11-00 && sudo apt-mark hold kubelet=1.15.11-00 kubeadm=1.15.11-00 kubectl=1.15.11-00
sudo systemctl enable kubelet && sudo systemctl start kubelet
We want to make sure that the /etc/hosts does not resolve the hostname to 127.0.0.1, if it does, comment it out.