切换命名空间后无法链接节点
AI-摘要
KunKunYu GPT
AI初始化中...
介绍自己
生成本文简介
推荐相关文章
前往主页
前往tianli博客
切换命名空间后无法链接节点
报错如下
[root@master1 opt]# kubectl run snowflake --image=nginx:1.7.9 --replicas=2
error: failed to discover supported resources: Get http://localhost:8080/apis/apps/v1?timeout=32s: dial tcp [::1]:8080: connect: connection refused
[root@master1 opt]# kubectl get deployment
The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决方法:
##把master1 admin.conf复制到其他master节点 并执行环境变量“主节点同上”
主节点操作
cat /etc/kubernetes/admin.conf
scp -r /etc/kubernetes/admin.conf 192.168.0.43:/etc/kubernetes/
三个master操作
[root@master1 opt]# echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >>~/.bash_profile
[root@master1 opt]# source ~/.bash_profile
[root@master1 opt]# kubectl run snowflake --image=nginx:1.7.9 --replicas=2
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/snowflake create
- 感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
作者编辑不易,如有转载请注明出处。完整转载来自https://wangairui.com 网站名称:猫扑linux
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果