检查集群状态

# 在 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
 二进制安装 kubernetes 1.12(五) - 运行测试实例 Cloud

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄