[root@k8s_master ~]# kubectl logs nginx-controller-shs0z
Error from server: Get https://192.168.132.136:10250/containerLogs/default/nginx-controller-shs0z/nginx: dial tcp 192.168.132.136:10250: getsockopt: connection refused
[root@k8s_master ~]# kubectl attach nginx-controller-shs0z -c nginx
If you don‘t see a command prompt, try pressing enter.
Error from server: error dialing backend: dial tcp 192.168.132.136:10250: getsockopt: connection refused
问题解决:
端口无法连接。
10250是kubelet的端口。 在Node上检查/etc/kubernetes/kubelet。 KUBELET_ADDRESS需要修改为node ip。
最终的/etc/kubernetes/kubelet内容如下:
重启kubelet
systemctl restart kubelet.service