0% found this document useful (0 votes)
7 views5 pages

Kubernetes Installation

Kubernetes installation

Uploaded by

gireeesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Kubernetes Installation

Kubernetes installation

Uploaded by

gireeesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 5

Docker installation on all the nodes

--------------------
sudo apt-get update
sudo apt-get install -y apt-transport-https
ca-certificates curl gnupg-agent software-
properties-common
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"

sudo apt-get update


sudo apt-get install -y docker-ce docker-
ce-cli containerd.io
sudo apt-mark hold docker-ce
sudo usermod -a -G docker $USER
sudo systemctl start docker
sudo docker version
sudo systemctl enable docker
Kubernetes installation:
----------------------
perform in all nodes:
=========================
sudo swapoff -a
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g'
/etc/fstab

below commands execute from root user:


---------------------------------

ubuntu :
---------
sudo su
apt-get update && apt-get install -y
curl -s
https://packages.cloud.google.com/apt/do
c/apt-key.gpg | apt-key add -
echo "deb https://apt.kubernetes.io/
kubernetes-xenial main" | tee
/etc/apt/sources.list.d/kubernetes.list
sudo apt-get update

Exit from root user

sudo apt-get -y install vim git curl wget


kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm
kubectl
sudo systemctl enable kubelet

kubeadm version

perform below commands in Master Node


alone
-------------------------------------------
sudo kubeadm init

After init ,if you got error like this

unknown service
runtime.v1alpha2.RuntimeService
----copy paste the following commands in
all the nodes
sudo rm /etc/containerd/config.toml
sudo systemctl restart containerd

After successful initialising run the


following commands with normal user in
master node only
sudo kubeadm init

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf
$HOME/.kube/config
sudo chown $(id -u):$(id -g)
$HOME/.kube/config

kubectl get nodes


kubectl apply -f
https://docs.projectcalico.org/manifests/cal
ico.yaml

Run the below command in other 2 worker


nodes with root user

kubeadm join 10.156.0.2:6443 --token


vc638m.xbmo4dktgmfsw9l8 \
--discovery-token-ca-cert-hash
sha256:eea7ea2fae4d4a0af8a020822048
83eb52a4e632c1645a94582649f4e7ab93
f6

if this join command won’t work use below


command to get new token in master
node only

kubeadm token create --print-join-


command

By using the above command you can get


the join token and copy paste that token in
worker nodes

You might also like