others-How to install kubeadm on ubuntu/debian system?

How to install kubeadm on ubuntu/debian system?

Target

Install kubeadm on ubuntu or debian system.

Environment

ubuntu environment is:

node $ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

Solution

You can do as follows on master and worker nodes of the kubernetes.

  • Install the kubeadm dependencies:
sudo apt-get update && sudo apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt-get update
  • Install the kubeadm itself:
apt install kubeadm

Do NOT use apt-get install, it would not ok.

References

You can view some references as follows: