Kubernetes Complete Installation
Kubernetes Complete Installation
=================================
1. apt update
2. swapoff -a
3. vi /etc/fstab
#comment swap file line
4. on master node :
hostnamectl set-hostname master
on worker node
hostnamectl set-hostname slave
5. ifconfig #note down ip address
6. vi /etc/network/interfaces
# ensure last 3 line as
" auto enp0s8
iface enp0s8 inet static
address <ip address>"
7. vi /etc/hosts #update host file with ipaddress nd name on corresponding nodes
8. apt install openssh-server
9. apt update
10. apt install docker.io
11. apt-get update && apt-get install -y apt-transport-https curl
12. curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
13. cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
14. apt-get update
15. vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
# add --> Environment="cgroup-driver=systemd/cgroup-diver=cgroupfs"
ON MASTERNODE
==============
16. sudo kubeadm init --pod-network-cidr=10.244.0.0/16 #notedown the following
informaton
from the output...kubeadm join command is very important"
17. to start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
ON WORKER NODE:
================
as a root user copy paste kubeadm join command
it looks like " kubeadm join <master ipaddress>:6443 --token
06tl4c.oqn35jzecidg0r0m --discovery-token-ca-cert-
hash sha256:c40f5fa0aba6ba311efcdb0e8cb637ae0eb8ce27b7a03d47be6d966142f2204c"