故障信息
pod一直处于创建中
查看pod详细信息显示
kubectl describe pod 容器id
文字
Events:
Type Reason Age From Message
Normal Scheduled 5m30s default-scheduler Successfully assigned default/nginx-server2-f97c6b9d5-d6dsp to worker02
Warning FailedCreatePodSandBox 5m29s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container “5e93531990f73e2b657ee34e3aca1ed846c3d2ebcc2e171c917f4095a4b5c09b” network for pod “nginx-server2-f97c6b9d5-d6dsp”: networkPlugin cni failed to set up pod “nginx-server2-f97c6b9d5-d6dsp_default” network: plugin type=“calico” failed (add): error getting ClusterInformation: connection is unauthorized: Unauthorized, failed to clean up sandbox container “5e93531990f73e2b657ee34e3aca1ed846c3d2ebcc2e171c917f4095a4b5c09b” network for pod “nginx-server2-f97c6b9d5-d6dsp”: networkPlugin cni failed to teardown pod “nginx-server2-f97c6b9d5-d6dsp_default” network: plugin type=“calico” failed (delete): error getting ClusterInformation: connection is unauthorized: Unauthorized]
Normal SandboxChanged 82s (x20 over 5m28s) kubelet Pod sandbox changed, it will be killed and re-created.
Warning FailedKillPod 29s (x5 over 79s) kubelet error killing pod: failed to “KillPodSandbox” for “134b665c-5400-414f-9849-9c1c23fafeb2” with KillPodSandboxError: “rpc error: code = Unknown desc = networkPlugin cni failed to teardown pod “nginx-server2-f97c6b9d5-d6dsp_default” network: plugin type=“calico” failed (delete): error getting ClusterInformation: connection is unauthorized: Unauthorized”
原因
Calico 网络插件的问题
解决方法
重启各节点的docker即可
systemctl restart docker
注:
如果这条命令显示pull代表本地没有所需镜像,正在下载,稍等即可
kubectl describe pod 容器id