Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Set by Step

Step1:
On Master & worker node
sudo su
cd
hostname master(in master as master, in node use node1)
exec bash(in master, in node also)
apt-get update
apt-get install docker.io -y
systemctl restart docker
systemctl enable docker
sudo apt-get install -y apt-transport-https ca-certificates curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main"
>/etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install kubeadm=1.25.4-00 kubectl=1.25.4-00 kubelet=1.25.4-00 -y

Step2:
On Master:
kubeadm init --pod-network-cidr=192.168.0.0/16 (just use kubeadm init it will
also work the same)
Copy the token and paste it into notepad.

Step3:
On Master:

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

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

kubectl apply -f
https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.49.0/
deploy/static/provider/baremetal/deploy.yaml

Step4:
On Node:
copy the url of we get while kubeadm init copy and paste to the node

now check the nodes are connected or not

Step 5
In master:
kubectl get nodes
o/p ---> master - ready
node1 - ready

(if its hang in node {preflight checkup} then go to instance sg group and allow all
the traffic in inbound and outound rule)

Our Kubernetes installation and configuration are complete

ex - kubeadm join 172.31.0.157:6443 --token easmb2.7spfazwt2y9ryxtf --discovery-


token-ca-cert-hash
sha256:636e865f3c6d5d68482b422f9a806d5b7ff0ea8fd8b8f8a3313406026c115171

You might also like