Skip to content

Instantly share code, notes, and snippets.

@chadmcrowell
Last active March 16, 2022 10:02
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save chadmcrowell/f2221cf33185c8c52d6e793320d69678 to your computer and use it in GitHub Desktop.
Save chadmcrowell/f2221cf33185c8c52d6e793320d69678 to your computer and use it in GitHub Desktop.
Installing the Kubernetes Cluster - From CKA Course - Linux Academy
# Get the Docker gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add the Docker repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Get the Kubernetes gpg key
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Add the Kubernetes repository
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
# Update your packages
sudo apt-get update
# Install Docker, kubelet, kubeadm, and kubectl
sudo apt-get install -y docker-ce=5:19.03.12~3-0~ubuntu-bionic kubelet=1.17.8-00 kubeadm=1.17.8-00 kubectl=1.17.8-00
# Hold them at the current version
sudo apt-mark hold docker-ce kubelet kubeadm kubectl
# Add the iptables rule to sysctl.conf
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf
# Enable iptables immediately
sudo sysctl -p
@carl-sl-li
Copy link

Suggested revision:

L21
sudo apt-get install -y docker-ce=5:19.03.123-0ubuntu-focal kubelet=1.17.8-00 kubeadm=1.17.8-00 kubectl=1.17.8-00

@KajKandler
Copy link

as of 07/28/20 only this version was available
sudo apt-get install -y docker-ce=5:19.03.9~3-0~ubuntu-focal kubelet=1.17.8-00 kubeadm=1.17.8-00 kubectl=1.17.8-00

@esmeburak
Copy link

for the acloud.guru provided lab servers I needed to run:
sudo modprobe br_netfilter
to be able to add iptables rules

@mkenne11
Copy link

mkenne11 commented Aug 15, 2020

@KajKandler I also noticed that only docker-ce=5:19.03.9~3-0~ubuntu-focal was available on the lab servers. This appears to be due to the servers being upgraded to Ubuntu 20.04 (Focal Fossa).

@sada498
Copy link

sada498 commented Sep 22, 2020

I would suggest using

sudo apt-get install -y docker-ce=18.06.0~ce~3-0~ubuntu kubelet=1.18.5-00 kubeadm=1.18.5-00 kubectl=1.18.5-00

@nkarthik
Copy link

when I try to install both versions for the deleted node and recreated new node

root@4748e5513c3c:# sudo apt install -y docker-ce=5:19.03.103-0ubuntu-focal kubelet=1.18.5-00 kubeadm=1.18.5-00 kubectl=1.18.5-00
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '5:19.03.10
3-0ubuntu-focal' for 'docker-ce' was not found
root@4748e5513c3c:
# ^Cubelet=1.18.5-00 kubeadm=1.18.5-00 kubectl=1.18.5-00
root@4748e5513c3c:# sudo apt-get install -y docker-ce=18.06.0ce3-0ubuntu kubelet=1.18.5-00 kubeadm=1.18.5-00 kubectl=1.18.5-00
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '18.06.0ce3-0ubuntu' for 'docker-ce' was not found
root@4748e5513c3c:
#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment