K8S的Deployment滚动升级指令整理
Deployment升级与回滚kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1kubectl set resources deployment/nginx-deployment -c=nginx--limits=cpu=200m,memory=512Mi#暂停kubectl rollout pause deploymen
·
Deployment升级与回滚
kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1
kubectl set resources deployment/nginx-deployment -c=nginx
--limits=cpu=200m,memory=512Mi
#暂停
kubectl rollout pause deployment/nginx-deployment
#恢复
kubectl rollout resume deployment/nginx-deployment
#查询升级状态
kubectl rollout status deployment/nginx-deployment
#查询升级历史
kubectl rollout histroy deploy/nginx-deployment
kubectl rollout histroy deploy/nginx-deployment --revision=2
#回滚
kubectl rollout undo deployment/nginx-deployment --to-revision=2
应用弹性升级
kubectl scale deployment nginx-deployment --replicas=10
# 对接heapster和HPA联动后 这个必须时集群支持 不支持是不是有这个效果的。
kubectl autoscale deployment nginx-deployment --min=10 --max=15 --cpu-percent=80
更多推荐
已为社区贡献2条内容
所有评论(0)