错误信息
Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "00b6872192203669df47261067fd3ce4df4ba9cbf171262669902030f5887dc7" network for pod "liveness-exec-demo": networkPlugin cni failed to set up pod "liveness-exec-demo_default" network: plugin type="calico" failed (add): error getting ClusterInformation: connection is unauthorized: Unauthorized, failed to clean up sandbox container "00b6872192203669df47261067fd3ce4df4ba9cbf171262669902030f5887dc7" network for pod "liveness-exec-demo": networkPlugin cni failed to teardown pod "liveness-exec-demo_default" network: plugin type="calico" failed (delete): error getting ClusterInformation: connection is unauthorized: Unauthorized]
表现为:
解决:
vim calico.yaml #编辑calico.yaml配置文件加入如下内容
- name: IP_AUTODETECTION_METHOD
value: "interface=eth0" #eth0是本地网卡名称
kubectl apply -f calico.yaml #更新