Kubernetes Cluster Installation Guide#
Sanity Setup and Pre-requisites#
Perform Sanity Checks on All Hosts
Master Node Setup#
Configure Networking for Kubernetes
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
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 --system
lsmod | grep br_netfilter
lsmod | grep overlay
sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward
sysctl -p
Install Container Runtime (containerd)
curl -LO https://github.com/containerd/containerd/releases/download/v1.7.14/containerd-1.7.14-linux-amd64.tar.gz
sudo tar Cxzvf /usr/local containerd-1.7.14-linux-amd64.tar.gz
curl -LO https://raw.githubusercontent.com/containerd/containerd/main/containerd.service
sudo mkdir -p /usr/local/lib/systemd/system/
sudo mv containerd.service /usr/local/lib/systemd/system/
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml
Enable and Start containerd
Install Runc
Install CNI Plugin
Install Kubernetes Components
Configure crictl for Containerd
Initialize Kubernetes Control Plane
# Load necessary Kubernetes images before initializing
kubeadm config images list
# Example images:
# registry.k8s.io/kube-apiserver:v1.30.1
# registry.k8s.io/kube-controller-manager:v1.30.1
# registry.k8s.io/kube-scheduler:v1.30.1
# registry.k8s.io/kube-proxy:v1.30.1
# registry.k8s.io/coredns/coredns:v1.11.1
# registry.k8s.io/pause:3.9
# registry.k8s.io/etcd:3.5.12-0
kubeadm init --kubernetes-version=v1.30.1 \
--control-plane-endpoint "hostIP:6443" \
--upload-certs \
--pod-network-cidr=10.244.0.0/16 \
--apiserver-advertise-address=hostIP
Set Up kubeconfig for kubectl
Install Calico for Networking
Worker Node Setup#
Repeat Master node Setup Steps and Join Cluster
If you need the join command again, run the following on the master node: