Loading video player...
Learn how to scale a Kubernetes cluster by adding a new worker node using kubeadm in this practical, step-by-step tutorial. This video focuses on real Kubernetes administration tasks, helping you understand when and why worker nodes are added to an existing clusterโessential knowledge for Kubernetes beginners, DevOps engineers, and CKA aspirants. โ๏ธ Check current Kubernetes cluster status ๐ฅ Understand real-world scenarios for adding worker nodes โ๏ธ Prepare a new worker node for kubeadm ๐ฅ Join the worker node to an existing Kubernetes cluster โ๏ธ Verify node readiness and cluster scaling ๐๏ธ Scaling Kubernetes: Adding a Worker Node 0:00 - ๐ฏ Intro: Solving Cluster Capacity Issues 0:48 - ๐ Identifying Resource Constraints 1:18 - ๐ Simulating Workload Pressure 2:17 - โ๏ธ Vertical vs. Horizontal Scaling 3:37 - ๐ฅ๏ธ Preparing the New Worker Node (OS Setup) 4:22 - ๐ Networking: Hostname & IP Configuration 7:02 - ๐ Verifying Node Connectivity (Master & Worker) 8:08 - ๐ซ Disabling Swap & Firewall 10:19 - ๐ ๏ธ Kernel Module & Networking Optimization 12:57 - โฑ๏ธ Time Synchronization with Chrony 13:25 - ๐ฆ Installing Container Runtime (Containerd) 15:51 - ๐ฅ Installing Kubeadm, Kubelet, and Kubectl 16:43 - ๐ Generating the Join Token on Master 17:26 - ๐ค Joining the New Node to the Cluster 18:09 - โ Verifying Recovery & New Capacity 18:30 - ๐ Testing Horizontal Scaling in Action 19:33 - ๐ Final Summary & Best Practices ๐ Key Commands Used : ๐น Disable Swap (Required for Kubernetes) sudo swapoff -a sudo vim /etc/fstab # comment the swap entry ๐น Load Required Kernel Modules sudo modprobe overlay sudo modprobe br_netfilter echo overlay | sudo tee /etc/modules-load.d/overlay.conf echo br_netfilter | sudo tee /etc/modules-load.d/br_netfilter.conf ๐น Kubernetes Networking sysctl Settings (Angle-Bracket Free) Create config file: sudo vim /etc/sysctl.d/k8s.conf Add the following lines: net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward = 1 Apply settings: sudo sysctl --system ๐น Install & Configure containerd (Critical) sudo dnf install -y dnf-plugins-core sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install -y containerd.io sudo mkdir -p /etc/containerd containerd config default | sudo tee /etc/containerd/config.toml โ ๏ธ Important change in config.toml SystemdCgroup = true sudo systemctl enable --now containerd ๐น Install Kubernetes Tools sudo tee /etc/yum.repos.d/kubernetes.repo Paste: [kubernetes] name=Kubernetes baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/ enabled=1 gpgcheck=1 gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key Then install: sudo dnf install -y kubelet kubeadm kubectl sudo systemctl enable kubelet ๐น Initialize Cluster (MASTER NODE) sudo kubeadm init \ --apiserver-advertise-address=MASTER_IP \ --pod-network-cidr=10.244.0.0/16 ๐น Configure kubectl (MASTER) mkdir -p $HOME/.kube sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config ๐น Install Pod Network (Flannel Example) kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml ๐น Join Worker Node to Cluster sudo kubeadm join MASTER_IP:6443 \ --token TOKEN_VALUE \ --discovery-token-ca-cert-hash sha256:HASH_VALUE ๐น Verify Cluster kubectl get nodes ๐ Watch the Full Kubeadm Labs Playlist: If you want to continue learning and building real multi-node Kubernetes clusters, check out our full playlist: [https://www.youtube.com/playlist?list=PL4y5PiOmBnA8-pXEE3Xwz28_QF-geOurS] ๐ Subscribe for more Kubernetes & DevOps tutorials and comment your questions below. #Kubernetes #kubeadm #DevOps #CKA #KubernetesTutorial