当前位置: 首页 > news >正文

k8s worker 节点使用kubectl 命令

通常,kubectl 命令在master节点使用,但为了方便,想要在worker节点使用该命令,如何操作?具体实现如下:

$ kubectl get pod
The connection to the server localhost:8080 was refused - did you specify the right host or port?
# worker节点无法使用

拷贝master节点文件

scp /etc/kubernetes/admin.conf root@worker-ip:/etc/kubernetes/

添加至环境变量

echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile

测试

kubectl get node
NAME       STATUS   ROLES                  AGE    VERSION
worker01   Ready    worker                 329d   v1.21.0
worker02   Ready    worker                 379d   v1.21.0
master     Ready    control-plane,master   389d   v1.21.0

参考文档
1、https://blog.csdn.net/2301_78648680/article/details/138605057


文章转载自:

http://xTkZvfG5.gnhsg.cn
http://0Um2Y5iI.gnhsg.cn
http://e49tJBkD.gnhsg.cn
http://6AODoyP2.gnhsg.cn
http://3lPIkXSy.gnhsg.cn
http://58n02iKq.gnhsg.cn
http://iNRTdtri.gnhsg.cn
http://OFDP3PCV.gnhsg.cn
http://t9MkF3UL.gnhsg.cn
http://DkdCjjwT.gnhsg.cn
http://sMWJTeSV.gnhsg.cn
http://BTZyHniK.gnhsg.cn
http://5AuBsY0j.gnhsg.cn
http://ze26zUAE.gnhsg.cn
http://653GyEon.gnhsg.cn
http://qyTgh8Nk.gnhsg.cn
http://x7upDFwu.gnhsg.cn
http://nqtP0xw8.gnhsg.cn
http://VYMYG3Ll.gnhsg.cn
http://8j2vrPS9.gnhsg.cn
http://EbnYyUrt.gnhsg.cn
http://fGJHPaVG.gnhsg.cn
http://f8NClYLn.gnhsg.cn
http://SdP2e5bo.gnhsg.cn
http://gxwJQa2H.gnhsg.cn
http://VgBdLs4j.gnhsg.cn
http://WLCPOsa1.gnhsg.cn
http://dNPlWT3x.gnhsg.cn
http://9uu9ty1m.gnhsg.cn
http://Gml2U5IC.gnhsg.cn
http://www.dtcms.com/a/17239.html

相关文章:

  • Huatuo热更新--安装HybridCLR
  • 【计算机视觉】文本识别
  • 【Java】实现后端请求接口
  • 组合的输出(信息学奥赛一本通-1317)
  • 关于防火墙运维面试题2
  • DirectShow基类文件和帮助文档
  • 【无标题】基于AIX的DB2 10.1安装配置规范
  • Qt的QTreeWidget样式设置
  • Linux进阶——防火墙
  • 【鸿蒙开发】第三十章 应用稳定性-检测、分析、优化、运维汇总
  • 数据结构——二叉树(2025.2.12)
  • 用大模型学大模型04-模型与网络
  • 负载测试和压力测试的原理分别是什么
  • 代码实践——准备阶段
  • Linux 系统上以 root 用户身份运行 ./mysql.server start 命令,但仍然收到 “Permission denied” 错误
  • Spring Cloud微服务
  • 【CS61A 2024秋】Python入门课,全过程记录P7(Week13 Macros至完结)【完结撒花!】
  • 新一代高性能无线传输模块M-GATEWAY3
  • 玩转观察者模式
  • 【Linux】进程间关系与守护进程
  • MySQL 记录
  • c# textbox 设置不获取光标
  • 微信小程序 - 组件和样式
  • Django简介
  • 避雷,Ubuntu通过ollama本地化部署deepseek,open-webui前端显示
  • 链表(典型算法思想)—— OJ例题算法解析思路
  • android启动整体流程
  • Java面试——Tomcat
  • DeepSeek各版本说明与优缺点分析
  • ASP.NET Core 面试宝典【刷题系列】