Install Debian 12
or install Debian 11.7 and Upgrade to 12
Setup
3 Nodes
192.168.100.151 k8s-master
192.168.100.152 k8s-worker1
192.168.100.153 k8s-worker2
Locale
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Kubernetes
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
Swap Off
swapoff -a
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
Install FW
apt-get install ufw
ufw enable
Master
ufw allow 22/tcp
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
Worker
ufw allow 22/tcp
ufw allow 10250/tcp
ufw allow 30000:32767/tcp
ufw reload
Containerd
cat << EOF >> /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF
modprobe overlay
modprobe br_netfilter
cat << EOF >> /etc/sysctl.d/99-kubernetes-k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF
sysctl --system
Containerd
apt update
apt -y install containerd
Adapt Containerd to Kubernetes
containerd config default > /etc/containerd/config.toml >/dev/null 2>&1
Update config.toml
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
Restart Containerd
systemctl enable containerd
systemctl restart containerd
add Kubernetes
apt install gnupg gnupg2 curl software-properties-common -y
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg |gpg --dearmour -o /etc/apt/trusted.gpg.d/cgoogle.gpg
apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
Kubectl
apt update
apt install kubelet kubeadm kubectl -y
apt-mark hold kubelet kubeadm kubectl
Kube Init on MASTER
kubeadm init --control-plane-endpoint=k8s-master
Downgrade to 1.26
Version 1.27 seems not production ready, so, you may have to downgrade it :(