環境準備
Installing kubeadm
sudo apt-get install -y apt-transport-https ca-certificates curl
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/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.28/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 kubectldisable swap
swapoff -a
grep '#/swap' /etc/fstab >/dev/null || sed -i '/\/swap.*swap/s/^\/swap/#\/swap/' /etc/fstab
grep '#/swapfile.*swap' /etc/fstab >/dev/null || sed -i '/\/swapfile.*swap/s/^\/swapfile/#\/swapfile/' /etc/fstab
rm -r /swap* &>/dev/nullsetting
tee /etc/modules-load.d/containers.conf<<EOF
br_netfilter
overlay
fuse
EOF
tee /etc/sysctl.d/containers.conf<<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOFinstall cri-o
Install cri-o and crun
cri-o config
Set crictl yaml
Set Service
Last updated