MENU

Kubenetes Installation with Debian Bookworm.

Conclusion

I will put the conclusion on the top beacuse the debian is not Google K8s suggested system. So many thing will be corrupted.

Installation

  1. Normal Debian installation.
  2. Enable IPv4/IPv6 forward.
echo "net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.conf
  1. Install Apt, Docker, And K8s.
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | tee /etc/apt/sources.list.d/docker.list

apt-get update -y 
apt-get install docker-ce docker-ce-cli containerd.io -y

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/k8s-archive-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/k8s-archive-keyring.gpg] http://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/k8s.list

apt-get update -y 
apt-get install kubelet kubeadm kubectl -y

Problems on Containerd.

  1. remove config.toml in case the oci standard container won't up.
rm /etc/containerd/config.toml
systemctl restart containerd
  1. Join the cluster.

Problems on Calico.

The problems here should be some sigkill singnal sent to the container. So we should modify the cgroupdriver from systemd to cgroupfs in case of error.

vim /var/lib/kubelet/config.yaml

cgroupDriver: cgroupfs

Also modifer the controller-plane:

kubectl edit cm kubelet-config -n kube-system

Done. Things maybe works fine now.