当然如果它说你的firewall有问题 先把firewall关掉
这个时候会出现
kubeadm init [WARNING Firewalld]: firewalld is active
先rm /etc/containerd/config.toml
接下来:
systemctl restart containerd
然后出现问题
Failed to restart containerd.service: Unit not found
然后解决方案是:(接 step 3 再kubeadm init就成功了)
Step 1. Install the containerd.io package from the official Docker repositories:
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y containerd.io
Step 2. Configure containerd:
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
Step 3. Restart containerd:
https://stackoverflow.com/questions/68630961/failed-to-restart-containerd-service-unit-not-found
systemctl restart containerd