检查集群状态 # 在 master 上 kubectl get node kubectl get cs 注册登录阿里云容器仓库
因国内无法获得 google 的 pause-amd64 镜像,我这里使用阿里云的。这里需要阿里云的帐号和密码。
在 node 节点上执行 sudo docker login --username={帐号} registry.cn-hangzhou.aliyuncs.com 运行测试实例 # 在 master 上执行 kubectl run nginx --image=nginx --replicas=3 kubectl expose deployment nginx --port=88 --target-port=80 --type=NodePort 获取 node 节点的 pod,svc 信息 # 提升权限 kubectl create clusterrolebinding system:anonymous --clusterrole=cluster-admin --user=system:anonymous kubectl get pods -o wide kubectl get svc根据获得的端口,访问nginx
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx