How to Install & Setup K8-Cluster using kubeadm

sweetestshuga

Eze Sugar 👩‍💻

Posted on August 13, 2024

How to Install & Setup K8-Cluster using kubeadm

UPDATE & SYSTEM APPICATION IN MASTER AND WORKER NODES
sudo apt-get update && sudo apt-get upgrade

INSTALL DOCKER IN SLAVE & MASTER

sudo apt install docker.io -y
sudo chmod 666 /var/run/docker.sock
Enter fullscreen mode Exit fullscreen mode

INSTALL PACKAGES FOR MASTER & SLAVES

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
sudo mkdir -p -m 755 /etc/apt/keyrings
Enter fullscreen mode Exit fullscreen mode

ADD KUBERNETES REPO AND CPG KEYS IN BOTH MASTER AND WORKER NODES

curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
Enter fullscreen mode Exit fullscreen mode

UPDATE PACKAGES IN ALL THE NODES

sudo apt update
Enter fullscreen mode Exit fullscreen mode

INSTALL COMPONENTS IN ALL THE NODES

 sudo apt install -y kubeadm=1.28.1-1.1 kubelet=1.28.1-1.1 kubectl=1.28.1-1.1
Enter fullscreen mode Exit fullscreen mode

INITIALIZE THE MASTER NODE | NB: ONLY ON MASTER

sudo kubeadm init --pod-network-cidr=10.244.0.0/16
Enter fullscreen mode Exit fullscreen mode

CONFIGURE KUBERNETES CLUSER | NB: ONLY 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
Enter fullscreen mode Exit fullscreen mode

DEPLOY CALICO |A NETWOKING SOLUTION | NB: ONLY ON MASTER

kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
Enter fullscreen mode Exit fullscreen mode

DEPLOY INGRESS CONTROLLER | NB: ONLY ON MASTER

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.49.0/deploy/static/provider/baremetal/deploy.yaml
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
sweetestshuga
Eze Sugar 👩‍💻

Posted on August 13, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024