網站首頁 編程語言 正文
k8s 之 kubectl 提示 “The connection to the server localhost:8080 was refused - did you ... port?”
作者:友發小猿 更新時間: 2022-07-13 編程語言The connection to the server localhost:8080 was refused - did you specify the right host or port?
將主節點(master)中的“/etc/kubernetes/admin.conf”文件拷貝到從節點(node)相同目錄下
scp /etc/kubernetes/admin.conf root@192.168.101.121:/etc/kubernetes/ && \
scp /etc/kubernetes/admin.conf root@192.168.101.122:/etc/kubernetes/ && \
scp /etc/kubernetes/admin.conf root@192.168.101.123:/etc/kubernetes/
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile
集群 ssh 免密登錄訪問
k8s 集群 ssh 免密登錄訪問
測試
[root@master-120 kubernetes] kg nodes
NAME STATUS ROLES AGE VERSION
master-120 Ready control-plane,master 3h31m v1.22.9
node-121 Ready <none> 3h26m v1.22.9
node-122 Ready <none> 3h26m v1.22.9
node-123 Ready <none> 3h26m v1.22.9
[root@master-120 etc] kgpodsw
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
coredns-687d9f64f-dlqq9 1/1 Running 3 (118m ago) 3h57m 10.244.0.8 master-120 <none> <none>
coredns-687d9f64f-hqch5 1/1 Running 3 (118m ago) 3h57m 10.244.0.9 master-120 <none> <none>
etcd-master-120 1/1 Running 3 (118m ago) 3h57m 192.168.101.120 master-120 <none> <none>
kube-apiserver-master-120 1/1 Running 3 (118m ago) 3h57m 192.168.101.120 master-120 <none> <none>
kube-controller-manager-master-120 1/1 Running 3 (118m ago) 3h57m 192.168.101.120 master-120 <none> <none>
kube-flannel-ds-44l8g 1/1 Running 3 (118m ago) 3h41m 192.168.101.123 node-123 <none> <none>
kube-flannel-ds-cf2zd 1/1 Running 4 (118m ago) 3h41m 192.168.101.121 node-121 <none> <none>
kube-flannel-ds-tkbnh 1/1 Running 5 (118m ago) 3h41m 192.168.101.120 master-120 <none> <none>
kube-flannel-ds-wxhk4 1/1 Running 3 (118m ago) 3h41m 192.168.101.122 node-122 <none> <none>
kube-proxy-4rt2z 1/1 Running 3 (118m ago) 3h57m 192.168.101.120 master-120 <none> <none>
kube-proxy-86jzc 1/1 Running 3 (118m ago) 3h52m 192.168.101.123 node-123 <none> <none>
kube-proxy-dmz5t 1/1 Running 3 (118m ago) 3h52m 192.168.101.122 node-122 <none> <none>
kube-proxy-sz9q2 1/1 Running 3 (118m ago) 3h52m 192.168.101.121 node-121 <none> <none>
kube-scheduler-master-120 1/1 Running 3 (118m ago) 3h57m 192.168.101.120 master-120 <none> <none>
[root@master-120 etc]#
原文鏈接:https://blog.csdn.net/qq_42476834/article/details/124730955
相關推薦
- 2024-03-24 spring boot 3 + spring cloud sleuth 無法注入Tracer問題
- 2022-06-15 GO語言字符串處理Strings包的函數使用示例講解_Golang
- 2022-04-09 C語言實現簡易計算器功能_C 語言
- 2022-01-06 npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to
- 2022-09-22 SGL:Self-supervised Graph Learning for Recommendat
- 2022-06-17 Python正則表達式的小練習分享_python
- 2023-01-26 Android原生集成RN最新版教程_Android
- 2022-09-25 python?opencv實現圖像矯正功能_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支