日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網(wǎng)站首頁 編程語言 正文

kubeadm報錯:The connection to the server localhost:8080 was refused - did you specify the right host

作者:Kevin古月 更新時間: 2022-04-01 編程語言

報錯現(xiàn)象

[root@k8s-node1 ~]# kubectl apply -f calico.yaml 
The connection to the server localhost:8080 was refused - did you specify the right host or port?

報錯原因

kubectl命令需要使用kubernetes-admin來運行

解決方法

將主節(jié)點(master節(jié)點)中的【/etc/kubernetes/admin.conf】文件拷貝到從節(jié)點相同目錄下:
scp -r /etc/kubernetes/admin.conf ${node1}:/etc/kubernetes/admin.conf

配置環(huán)境變量:
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile

立即生效:
source ~/.bash_profile


原文鏈接:https://blog.csdn.net/m0_47219942/article/details/110873509

欄目分類
最近更新