当前位置:网站首页>在腾讯云容器服务Node上执行 kubectl
在腾讯云容器服务Node上执行 kubectl
2022-07-03 09:48:00 【k8s入门教程】
默认 容器服务 的 Node 上无法执行 kubectl
,需要配置集群访问凭证,如果你开启了内网访问
按照官方教程很好解决,这里介绍下在不开启内网访问的情况下,如何在 Node 上执行 kubectl。
现在内网 CLB 收费了,直接使用容器服务默认内网访问的方式钱有点不够,简单改一下 apiserver 的地址,即可实现 kubectl 访问。
默认节点是无法使用 kubectl 访问的
# kubectl get node
error: You must be logged in to the server (Unauthorized)
按如下操作以下
1. 获取 APIServer 的 地址
在 ~/.kube/config
中可以找到这一行配置,记录下来,下一步要用
server: https://169.254.128.16:60002
如果没找到,也可以通过命令行获取
[[email protected] .kube]# netstat -tnp | grep kube
tcp 0 0 10.1.0.20:58804 169.254.128.16:60002 ESTABLISHED 2240947/kubelet
2. 修改连接集群的访问凭证 ~/.kube/config
在集群基础信息页中,复制上文截图的 kubeconfig部分 到 ~/.kube/config
中,修改 server 地址
为上一步获取的 APIServer地址。
3. 验证 kubectl
访问成功
# kubectl get node
NAME STATUS ROLES AGE VERSION
10.1.0.99 Ready <none> 2y200d v1.20.6-tke.20
...
边栏推荐
- Summary of the history of Mathematics
- Crawl with requests
- Cache routing component
- Solve the problem that pycharm Chinese input method does not follow
- C language project: student achievement system
- Solution: jupyter notebook does not pop up the default browser
- QT:QSS自定义QGroupBox实例
- What kind of living condition is a tester with a monthly salary of more than 10000?
- 搭建ADG后,实例2无法启动 ORA-29760: instance_number parameter not specified
- QT: QSS custom qtreeview instance
猜你喜欢
QT: QSS custom qtableview instance
英特尔13代酷睿旗舰曝光,单核5.5GHz
The five-year itch of software testing engineers tells the experience of breaking through bottlenecks for two years
. Net core - a queuing system for wechat official account
Clion debug
做软件测试三年,薪资不到20K,今天,我提出了辞职…
嵌入式軟件測試怎麼實現自動化測試?
【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解
12. Nacos server service registration of source code analysis of Nacos service registration
What kind of living condition is a tester with a monthly salary of more than 10000?
随机推荐
Flink-- custom function
Qt:qss custom qlistview instance
Redis notes 01: Introduction
C language project: student achievement system
The role and necessity of implementing serializable interface
Stack, monotone stack, queue, monotone queue
月薪过万的测试员,是一种什么样的生活状态?
嵌入式软件测试怎么实现自动化测试?
我,大厂测试员,降薪50%去国企,后悔了...
MAUI Developer Day in GCR
Extern keyword
【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯
有赞CTO崔玉松:有赞Jarvis核心目标是使产品变得更加聪明和可靠
First line of code kotlin notes
. Net core - a queuing system for wechat official account
Flink -- built in function (all)
栈,单调栈,队列,单调队列
Software testing (test case) writing: vulgar, native and skillful
反正切熵(Arctangent entropy):2022.7月最新SCI论文
软件测试(测试用例)编写之俗手、本手、妙手