当前位置:网站首页>在腾讯云容器服务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/kubelet2. 修改连接集群的访问凭证 ~/.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
...边栏推荐
- Flink-- custom function
- T5 的尝试
- Activity and fragment lifecycle
- After 8 years of industry thinking, the test director has a deeper understanding of test thinking
- QT: QSS custom qtableview instance
- 12. Nacos server service registration of source code analysis of Nacos service registration
- My understanding of testing (summarized by senior testers)
- 如何让让别人畏惧你
- 10. Nacos source code construction
- Snownlp emotion analysis
猜你喜欢

Cache routing component

现在零基础转行软件测试还OK吗?

How did I grow up in the past eight years as a test engineer of meituan? I hope technicians can gain something after reading it

redis那些事儿

STM32F1与STM32CubeIDE编程实例-TM1637驱动4位7段数码管

The five-year itch of software testing engineers tells the experience of breaking through bottlenecks for two years

Crawl with requests

那些一門心思研究自動化測試的人,後來怎樣了?

那些一门心思研究自动化测试的人,后来怎样了?

ByteDance layoffs, test engineers were almost destroyed: how terrible is the routine behind the recruitment of large factories?
随机推荐
月薪过万的测试员,是一种什么样的生活状态?
The testing department of the company came to the king of the Post-00 roll, and the veteran exclaimed that it was really dry, but
Cache routing component
File upload and download test point
MAUI Developer Day in GCR
MAUI Developer Day in GCR
Redis notes 01: Introduction
QT:QSS自定义QMenu实例
现在零基础转行软件测试还OK吗?
Multiple IO transfer - preamble
Flink -- built in function (all)
Error installing the specified version of pilot
2021 reading summary (continuously updating)
Qt:qss custom qlineedit instance
Use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
15 software testing Trends Worthy of attention
What experience is there only one test in the company? Listen to what they say
QT: QSS custom qtableview instance
Qt:qss custom qlistview instance
Qt:qss custom QSlider instance