diff --git a/Installation/Installation Kubernetes-Cluster.md b/Installation/Installation Kubernetes-Cluster.md index bc32183..67fd0a2 100644 --- a/Installation/Installation Kubernetes-Cluster.md +++ b/Installation/Installation Kubernetes-Cluster.md @@ -1,59 +1,62 @@ +# Install instructions for a 3-Node Kubernetes Cluster + ## Prerequisites Minimal Installed Debian 12/11, 2 CPU / vCPU, 2 GB RAM, 20 GB free disk space, Sudo User with Admin rights, Stable Internet Connectivity Ensure that each node can communicate with the others via a reliable network connection. -# Lab Setup +## Lab Setup For the demonstration, I am using three Debian 12 systems. -Master Node (k8s-master) – 192.168.1.23 -Worker Node 1 (k8s-worker01) – 192.168.1.24 -Worker Node 2 (k8s-worker02) – 192.168.1.25 -Without any further delay, let’s jump into Kubernetes Cluster installation steps. +Master Node (vmcon-master.his.de) – 192.168.202.10 +Worker Node 1 (vmcon-node1.his.de) – 192.168.202.11 +Worker Node 2 (vmcon-node2.his.de) – 192.168.202.12 + + +# Installation ## Set Host Name and Update Hosts File Login to each node (master & woker nodes) and set their hostname using hostnamectl command. -$ sudo hostnamectl set-hostname "k8s-master.linuxtechi.local" // Run on master node -$ sudo hostnamectl set-hostname "k8s-worker01.linuxtechi.local" // Run on 1st worker node -$ sudo hostnamectl set-hostname "k8s-worker02.linuxtechi.local" // Run on 2nd worker node +$ hostnamectl set-hostname "vmcon-master.his.de" // Run on master node +$ hostnamectl set-hostname "vmcon-node1.his.de" // Run on 1st worker node +$ hostnamectl set-hostname "vmcon-node2.his.de" // Run on 2nd worker node Also add the following entries in /etc/hosts file on all the nodes, -192.168.1.23 k8s-master.linuxtechi.local k8s-master -192.168.1.24 k8s-worker01.linuxtechi.local k8s-worker01 -192.168.1.25 k8s-worker02.linuxtechi.local k8s-worker02 +192.168.202.10 vmcon-master.his.de vmcon-master.his.de +192.168.202.11 vmcon-node1.his.de vmcon-node1 +192.168.202.12 vmcon-node2.his.de vmcon-node2 ## Disable Swap on All Nodes For kubelet to work smoothly, it is recommended to disable swap. Run following commands on master and worker nodes to turn off swap. -$ sudo swapoff -a -$ sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab +$ swapoff -a +$ sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab ## Add Firewall Rules for Kubernetes Cluster In case, OS firewall is enabled on your Debian systems then allow following ports on master and worker nodes respectively. On Master node, run +$ ufw allow 6443/tcp +$ ufw allow 2379/tcp +$ ufw allow 2380/tcp +$ ufw allow 10250/tcp +$ ufw allow 10251/tcp +$ ufw allow 10252/tcp +$ ufw allow 10255/tcp +$ ufw reload -$ sudo ufw allow 6443/tcp -$ sudo ufw allow 2379/tcp -$ sudo ufw allow 2380/tcp -$ sudo ufw allow 10250/tcp -$ sudo ufw allow 10251/tcp -$ sudo ufw allow 10252/tcp -$ sudo ufw allow 10255/tcp -$ sudo ufw reload On Worker Nodes, +$ ufw allow 10250/tcp +$ ufw allow 30000:32767/tcp +$ ufw reload -$ sudo ufw allow 10250/tcp -$ sudo ufw allow 30000:32767/tcp -$ sudo ufw reload Note: If firewall is disabled on your Debian 12/11 systems, then you can skip this step. ## Install Containerd Run time on All Nodes Containerd is the industry standard container run time and supported by Kubernetes. So, install containerd on all master and worker nodes. Before installing containerd, set the following kernel parameters on all the nodes. - $ cat </dev/null 2>&1 -Set cgroupdriver to systemd on all the nodes, Edit the file ‘/etc/containerd/config.toml’ and look for the section ‘[plugins.”io.containerd.grpc.v1.cri”.containerd.runtimes.runc.options]’ and change ‘SystemdCgroup = false’ to ‘SystemdCgroup = true‘ - $ sudo vi /etc/containerd/config.toml + Enable-SystemCgroup-Containerd-Debain12 Save and exit the file.