kubeadm 安装k8s集群后,master和node节点notready问题解决方案
使用kubeadm 安装k8s集群后,加载calico cni 网络组件后,master节点notready问题解决方案
1,使用kubeadm 安装k8s集群后,加载calico cni 网络组件后,master节点notready问题
表现为:
使用命令查看日志:journalctl -f -u kubelet
报错如下:
Failed to start ContainerManager failed to initialize top level QOS containers: failed to update top level Burstable QOS cgroup : failed to set supported cgroup subsystems for cgroup [kubepods burstable]: failed to find subsystem mount for required subsystem: pids
此问题解决方案为:
echo 'KUBELET_EXTRA_ARGS="--feature-gates SupportPodPidsLimit=false --feature-gates SupportNodePidsLimit=false"' > /etc/sysconfig/kubelet
systemctl stop kubelet
systemctl start kubelet
systemctl status kubelet
再次查看nodes状态,发现文件POD全部加载成功,nodes状态也正常了。
2,使用kubeadm 安装k8s集群后,加载calico cni 网络组件后,node节点notready问题
查看报错日志:
journalctl -f -u kubele
9a2c-b26f-4ed9-b1e1-896cd80ac86e)" failed: rpc error: code = Unknown desc = failed to set up sandbox container "2a4c1e14e45cde3612ffa89a05429570d128a5d6b5fb5526fd257fb329fa895f" network for pod "calico-kube-controllers-577f77cb5c-fspkp": networkPlugin cni failed to set up pod "calico-kube-controllers-577f77cb5c-fspkp_kube-system" network: stat /var/lib/calico/nodename: no such file or directory: check that the calico/node container is running and has mounted /var/lib/calico/
Mar 21 20:06:38 master kubelet[48715]: E0321 20:06:38.211904 48715 pod_workers.go:191] Error syncing pod 35469a2c-b26f-4ed9-b1e1-896cd80ac86e ("calico-kube-controllers-577f77cb5c-fspkp_kube-system(35469a2c-b26f-4ed9-b1e1-896cd80ac86e)"), skipping: failed to "CreatePodSandbox" for "calico-kube-controllers-577f77cb5c-fspkp_kube-system(35469a2c-b26f-4ed9-b1e1-896cd80ac86e)" with CreatePodSandboxError: "CreatePodSandbox for pod \"calico-kube-controllers-577f77cb5c-fspkp_kube-system(35469a2c-b26f-4ed9-b1e1-896cd80ac86e)\" failed: rpc error: code = Unknown desc = failed to set up sandbox container \"2a4c1e14e45cde3612ffa89a05429570d128a5d6b5fb5526fd257fb329fa895f\" network for pod \"calico-kube-controllers-577f77cb5c-fspkp\": networkPlugin cni failed to set up pod \"calico-kube-controllers-577f77cb5c-fspkp_kube-system\" network: stat /var/lib/calico/nodename: no such file or directory: check that the calico/node container is running and has mounted /var/lib/calico/"
这里可以看到,日志中报的是node2缺少 /var/lib/calico/ 这个文件夹
所以要到node2的服务器上执行:mkdir -p /var/lib/calico/
再次
kubectl apply -f calico.yaml
即可解决
更多推荐
所有评论(0)