k8s的node節點,執行kubectl get XXX報錯


報錯現象:

[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]#


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM