运行命令进入pod

kubectl exec -it nginx-3449338310-sffj4 /bin/bash

发现报错如下

Error from server: error dialing backend: dial tcp 192.168.222.137:10250: getsockopt: connection refused

发现根本原因是node节点上的/etc/kubernetes/kubelet配置文件中如下:

KUBELET_ADDRESS="--address=127.0.0.1"

此处应该更改为

KUBELET_ADDRESS="--address=192.168.222.137"

更改配置文件之后分别重启node节点上的kubelet

systemctl restart kubelet