K8s Installation - philipf/notebook GitHub Wiki
Installation of GPG keys might be required. See docker and K8s documentation to install relevant repos.
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"
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
The following packages are required and needs to be installed on the Master and Nodes
A package manager like apt
install can work.
The version should match the other k8s packages.
Docker community edition
Manages containers running on a single host.
Helps to install at k8s cluster
Is a command line tool for controlling Kubernetes clusters
sudo apt-get update
sudo apt-get install -y docker-ce=18.06.1~ce~3-0~ubuntu kubelet=1.13.5-00 kubeadm=1.13.5-00 kubectl=1.13.5-00
# Exclude these packages from updates
sudo apt-mark hold docker-ce kubelet kubeadm kubectl
Not sure why yet. According to: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#network-plugin-requirements
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
sudo kubeadm init --prod-network-cidr=10.244.0.0/16
This produce a message such as:
Your Kubernetes master has initialized successfully!
...
...
(I don't understand why yet)
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml
Follow these instructions and copy the kubeadm join
command and run on every node
On the Master
kubectl get nodes
It should show something like this (for 1 Master and 2 Nodes)
ubuntu@ip-172-31-24-255:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-172-31-20-139 Ready <none> 69s v1.13.5
ip-172-31-24-255 Ready master 26m v1.13.5
ip-172-31-28-23 Ready <none> 79s v1.13.5