111111

k8s-kubectl命令管理工具

1、部署应用
kubectl create deployment web --image=nginx:1.14 
kubectl get deploy,pods
2、暴露应用
kubectl expose deployment web --port=80 --type=NodePort --target-port=80 --name=web
kubectl get service
3、应用升级
kubectl set image deployment/web nginx=nginx:1.15
kubectl rollout status deployment/web 
4、应用回滚
kubectl rollout history deployment/web
kubectl rollout undo deployment/web
kubectl rollout undo deployment/web --revision=2
5、扩容/缩容
kubectl scale deployment web --replicas=10

 

posted @ 2020-07-20 10:22  赵SIR  阅读(272)  评论(0编辑  收藏  举报