- https://kubernetes.io/docs/setup/production-environment/container-runtimes/ (search: containerd)
- https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ (search (kubeadm))
- https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/ (search: kubeadm)
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
sudo apt-get update && sudo apt-get install -y containerd
sudo mkdir -p /etc/containerd
sudo containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd
sudo systemctl status containerd
sudo swapoff -a
# IMPORTANT: in real life also check /etc/fstab for configured swap (comment out or remove line(s) entirely)
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl gpg
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/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.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update && sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
NOTE: only on control plane node
sudo kubeadm init --pod-network-cidr 192.168.0.0/16 --kubernetes-version=1.29.0
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.2/manifests/tigera-operator.yaml
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.2/manifests/custom-resources.yaml
kubectl get pods -n calico-system
kubectl get nodes
kubeadm token create --print-join-command
sudo kubeadm join 10.0.1.101:6443 --token kjml1s.hspasotb2a0ny8s3 --discovery-token-ca-cert-hash sha256:c5a18b0c6dc74ba83a5f843f07e443fe7e8c3498f940ceb2610c4932f5cc53fb
# IMPORTANT: use output from the command in 5.1 here
kubectl get nodes