0% found this document useful (0 votes)
26 views

Kubernetes Complete Installation

The document provides steps to install Kubernetes on both master and worker nodes. It includes steps like setting up Docker, installing Kubernetes packages, initializing the master node with kubeadm, joining worker nodes and deploying the Kubernetes dashboard.

Uploaded by

Yuvaraj
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Kubernetes Complete Installation

The document provides steps to install Kubernetes on both master and worker nodes. It includes steps like setting up Docker, installing Kubernetes packages, initializing the master node with kubeadm, joining worker nodes and deploying the Kubernetes dashboard.

Uploaded by

Yuvaraj
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

KUBERNETES INSTALLATION STEPS:

=================================

set network of vms as bridge


------------ ------------
ON BOTH MASTER AND NODE:-

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

apt-get install -y kubelet kubeadm kubectl

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

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

sudo chown $(id -u):$(id -g) $HOME/.kube/config

18. sudo kubectl apply -f


https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-
flannel.yml

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"

KUBERNETES dashboard: on MASTERNODE


==================================
#build dashboard using following command
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-
beta4/aio/deploy/recommended.yaml

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | awk


'/^deployment-controller-token-/{print $1}') | awk '$1=="token:"{print $2}'
#create token nd copy paste the token in dashboard token optiion

You might also like