linux和windows系统使用k8s控制节点的kubernetes资源

一般linux获取master控制节点的授权:

复制代码
[root@harbor ~]# vim /etc/hosts
192.168.1.30    harbor
192.168.1.50    master
192.168.1.51    node-0001
192.168.1.52    node-0002
192.168.1.53    node-0003
192.168.1.54    node-0004
192.168.1.55    node-0005

#下载插件
dnf install -y kubectl
# 管理授权
mkdir -p $HOME/.kube
rsync -av master:/etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config

#验证
[root@harbor ~]# kubectl get nodes

windows系统获取master控制节点的授权:

先下载kubernetes插件

然后在编辑器的控制台输入:

复制代码
$ mkdir -p $HOME/.kube

$ scp root@192.168.1.50:/etc/kubernetes/admin.conf $HOME/.kube/config

The authenticity of host '192.168.1.50 (192.168.1.50)' can't be established.
ED25519 key fingerprint is SHA256:vn9vQ+resIqP5JZMCWQrEza8CbygLw0k+q4s9tKV3Hw.
This host key is known by the following other names/addresses:
   ...
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.50' (ED25519) to the list of known hosts.
root@192.168.1.50's password: 
admin.conf  

$ kubectl.exe get pods
NAME    READY   STATUS             RESTARTS         AGE
test2   0/1     CrashLoopBackOff   14 (2m58s ago)   49m
web1    1/1     Running            0                23h
web2    1/1     Running            0                23h
web3    1/1     Running            0                23h

注意:只有cmd控制台的,想要上述的控制台效果,可以将terminal改成git的bash-shell

也可以手动下载,记得要配置环境变量:

kubernetes/CHANGELOG at master · kubernetes/kubernetes · GitHub

相关推荐
A小辣椒40 分钟前
TShark:基础知识
linux
AlfredZhao3 小时前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao17 小时前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334661 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪1 天前
linux 拷贝文件或目录到指定的位置
linux
大树882 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠2 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质2 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush42 天前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行5202 天前
Linux 11 动态监控指令top
linux