1.创建
kubectl run nginx --replicas=3 --labels=“app=example” --image=nginx:1.10 --port=80
2.查看
kubectl get all(查询所有资源信息)
kubectl get deploy
kubectl get pods --show-tabels
kubectl get pods -l app=example
kubectl get pods -o wide
kubectl set —help
3.发布
kubectl expose deployment nginx --port=88 --type=NodePort --target-port=80 --name=nginx-service
kubectl describe service nginx-=service
4.故障排查
kubectl describle TYPE NAME_PREFIX
kubectl log nginx–xxx
kubectl exec -it nginx–xxx bash
5跟新镜像
kubectl set images deployment/nginx=nginx:1.11(原先为1.10)
kubectl set images deployment/nginx=nginx:1.13 --record=true
然后可以用kubectl get all进行查询
跟新镜像后进行查询:kubectl get pods
查看更新的细节:kubectl describe pod 《容器名称》
除此之外,