sudo swapoff -a
sudo apt update; sudo apt dist-upgrade -y; sudo apt autoremove -y; sudo flatpak update -y
sudo apt install kubelet kubeadm kubectl docker-ce containerd.io cri-tools kubernetes-cni
cp ~/Downloads/cri-dockerd_0.3.4.3-0.ubuntu-jammy_amd64.deb /tmp/
sudo apt install /tmp/cri-dockerd_0.3.4.3-0.ubuntu-jammy_amd64.deb
# sudo apt-mark hold kubelet kubeadm kubectl
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --cri-socket=unix:///var/run/cri-dockerd.sock --apiserver-advertise-address=192.168.100.1 --control-plane-endpoint=192.168.100.1
rm -rf $HOME/.kube
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 -o wide
kubectl get pods -A -o wide
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/tigera-operator.yaml
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/custom-resources.yaml
kubectl create -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
kubectl get nodes -o wide
kubectl get pods -A -o wide
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
kubectl get nodes -o wide
kubectl get pods -A -o wide
kubectl run -i --tty --rm debug --image=busybox --restart=Never -- sh
kubectl get pods -A -o wide
kubectl delete pods debug
kubectl delete -f https://docs.projectcalico.org/v3.8/manifests/calico.yaml
kubectl delete -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/tigera-operator.yaml
kubectl delete -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/custom-resources.yaml
kubectl delete -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml
kubectl delete pods --all-namespaces=true --all=true
sudo systemctl restart kubelet
sleep 3
kubectl get nodes -o wide
kubectl get pods -A -o wide
sudo kubeadm reset --cri-socket=unix:///var/run/cri-dockerd.sock
rm -rf ~/.kube/
sudo apt remove --purge docker-ce cri-dockerd containerd.io kubelet kubeadm kubectl runc cri-tools kubernetes-cni
sudo rm -rf /var/lib/kubelet/ /var/lib/cni/ /var/lib/calico/ /var/lib/containerd/ /var/lib/etcd/ /opt/cni/ /opt/containerd/ /etc/kubernetes/ /etc/cni/ /var/run/calico/ /run/docker /run/docker.sock /var/lib/docker /var/lib/cri-dockerd/ /var/run/containerd /var/run/cri-dockerd.sock /var/run/docker /var/run/flannel /var/lib/libvirt/dnsmasq/kubernetes.*
ip route flush proto bird
ip link list | grep cali | awk '{print $2}' | cut -c 1-15 | xargs -I {} ip link delete {}
modprobe -r ipip