报错现象:
[root@localhost ~]# kubectl get nodes The connection to the server localhost:8080 was refused - did you specify the right host or port?
但是也想让子节点可以查询,因此研究了一下
把master下面的admin.conf移到子节点相同路径下
[root@localhost manifests]# cd /etc/kubernetes [root@localhost kubernetes]# ll 总用量 4 -rw------- 1 root root 1856 12月 16 17:06 kubelet.conf drwxr-xr-x 2 root root 6 10月 3 06:16 manifests drwxr-xr-x 2 root root 20 12月 16 17:06 pki [root@localhost kubernetes]# echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile [root@localhost kubernetes]# source ~/.bash_profile [root@localhost kubernetes]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master NotReady master 36m v1.16.1 k8s-node01 NotReady <none> 13m v1.16.1 [root@localhost kubernetes]#
所有评论(0)