当前位置:网站首页>在腾讯云容器服务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
...边栏推荐
- My understanding of testing (summarized by senior testers)
- Error installing the specified version of pilot
- glassfish org. h2.server. Shutdownhandler classnotfoundexception exception exception handling
- 公司里只有一个测试是什么体验?听听他们怎么说吧
- 【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解
- File upload and download test point
- php如何解决高并发问题
- Logstash backup tracks the data records reported
- 反正切熵(Arctangent entropy):2022.7月最新SCI论文
- What happened to those who focused on automated testing?
猜你喜欢

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

Que se passe - t - il ensuite pour ceux qui se sont concentrés sur les tests automatisés?

. Net core - a queuing system for wechat official account

软件测试——Redis数据库

Game test related tests a hero's skills (spring moves are asked more questions)

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

字节跳动大裁员,测试工程师差点遭团灭:大厂招人背后的套路,有多可怕?

What happened to those who focused on automated testing?

EPS电动转向系统分析

QT: QSS custom qtreeview instance
随机推荐
公司里只有一个测试是什么体验?听听他们怎么说吧
Qt:qss custom qscrollbar instance
Differences among norm, normalize and normalized in eigen
字节跳动大裁员,测试工程师差点遭团灭:大厂招人背后的套路,有多可怕?
Extern keyword
The highest monthly salary of 18K has a good "mentality and choice", and success is poor "seriousness and persistence"~
Solve the problem that pycharm Chinese input method does not follow
Basic theoretical knowledge of software testing -- app testing
Stack, monotone stack, queue, monotone queue
Latest sales volume of pinduoduo
EPS电动转向系统分析
Activity and fragment lifecycle
The solution that prompts "system group policy prohibits the installation of this device" under win10 system (home version has no group policy)
Qt:qss custom QSlider instance
Snownlp emotion analysis
Qt:qss custom qradiobutton instance
月薪过万的测试员,是一种什么样的生活状态?
The element form shows the relationship between elementary transformation and elementary matrix
Large scale e-commerce project - environment construction
QT:QSS自定义QListView实例