Skip to content

Instantly share code, notes, and snippets.

@iMilad
Forked from chadmcrowell/install-docker-kube.sh
Last active August 28, 2020 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iMilad/7ed3c5a2ecaa8c1670a1c6ca7320bf4f to your computer and use it in GitHub Desktop.
Save iMilad/7ed3c5a2ecaa8c1670a1c6ca7320bf4f 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-focal kubelet=1.19.0-00 kubeadm=1.19.0-00 kubectl=1.19.0-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment