报错现象:

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-09-03
  • 2022-02-20
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2021-09-26
  • 2021-07-27
  • 2022-12-23
  • 2021-10-05
相关资源
相似解决方案