Deploy a Kubernetes cluster using kubeadm, containerd, and Calico.
- Ubuntu
- Kubernetes
- Containerd
- Calico
+----------------+
| Control Plane |
| kube-apiserver |
| etcd |
| scheduler |
+--------+-------+
|
----------------------------
| |
+------+-------+ +------+-------+
| Worker Node1 | | Worker Node2 |
| kubelet | | kubelet |
| containerd | | containerd |
+------+-------+ +------+-------+
| |
+------------+-------------+
|
+------+------+
| Calico |
| Network |
+-------------+
- 4 VMs Ubuntu 22.04 — 1 control plane, 3 worker nodes.
- Static IPs assigned to each VM.
- /etc/hosts updated with hostname → IP mappings for all nodes.
- Swap disabled on all nodes.
SSH into control plane:
ssh priyanka@my-ubuntu-1Number 0 to Number 4 need to be applied on control plane and workers
sudo swapoff -a
sudo vi /etc/fstabRemove any swap entries.
Load kernel modules:
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilterSystem settings:
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
sudo sysctl --systemsudo apt-get install -y containerd
sudo mkdir -p /etc/containerd
sudo containerd config default | sudo tee /etc/containerd/config.tomlEdit containerd config to use systemd cgroups:
sudo sed -i 's/ SystemdCgroup = false/ SystemdCgroup = true/' /etc/containerd/config.tomlVerify:
grep 'SystemdCgroup = true' /etc/containerd/config.tomlRestart:
sudo systemctl restart containerd
sudo systemctl enable containerdAdd repository:
sudo apt update && sudo apt-get install -y apt-transport-https ca-certificates curl gpg conntrack
sudo curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/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.31/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.listUpdate and check versions:
sudo apt-get update
apt-cache policy kubelet | head -n 20Install Kubernetes:
VERSION=1.31.14-1.1
sudo apt-get install -y kubelet=$VERSION kubeadm=$VERSION kubectl=$VERSION
sudo apt-mark hold kubelet kubeadm kubectl containerd
sudo systemctl enable --now kubeletsudo systemctl status kubelet.service
sudo systemctl status containerd.servicekubelet will show inactive (dead) until cluster is initialized with kubeadm init or joined with kubeadm join.
Log into the control plane:
ssh priyanka@my-ubuntu-1Download Calico manifest:
wget https://raw.githubusercontent.com/projectcalico/calico/master/manifests/calico.yamlEdit Pod CIDR if needed:
vi calico.yamlInitialize the cluster:
sudo kubeadm init --kubernetes-version v1.31.14Set up kubeconfig:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/configApply Calico:
kubectl apply -f calico.yamlWatch pods:
kubectl get pods --all-namespaces --watchCheck when all system pods are Running:
kubectl get pods --all-namespacesCheck nodes:
kubectl get nodesLog out of the worker node and return to the control plane:
exitGenerate the cluster join command:
kubeadm token create --print-join-commandCopy the output — you'll need it for each worker node.
SSH into the first worker node:
ssh priyanka@my-ubuntu-2Run the join command (example — your token will differ):
sudo kubeadm join <CONTROL_PLANE_IP>:6443 \
--token <TOKEN> \
--discovery-token-ca-cert-hash sha256:<HASH>Return to control plane:
exitCheck node status (will be NotReady until network pod is deployed):
kubectl get nodesWatch pods across all namespaces:
kubectl get pods --all-namespacesVerify worker node becomes Ready:
kubectl get nodesCause: Firewall ports were blocked.
Resolution: Required Kubernetes ports were opened and the join command was executed again.
Cause: Network configuration mismatch.
Resolution: Re-applied Calico manifest and verified pod status.
- Understanding of Kubernetes cluster architecture.
- Experience with kubeadm-based installation.
- Familiarity with containerd runtime configuration.
- Improved troubleshooting skills for node and networking issues.
- Better understanding of Kubernetes networking using Calico.
Successfully deployed a Kubernetes cluster using kubeadm and containerd with Calico networking. Verified node readiness, system pod health, and cluster networking functionality.

