kubernetes deployments升级与回滚

  sre

查看部署状态:

kubectl get deployments -n test
kubectl rollout status deployments test-service -n test
kubectl describe deployments test-service -n test

升级

kubectl set image deployments test-service *=hub.test.global/test/test-service:2.0.0.313 -n test
kubectl set image deployments test-service *=hub.test.global/test/test-service:2.0.0.314 -n test

回滚

kubectl rollout undo deployments test-service -n test

查看deployments版本

kubectl rollout history deployments -n test

回滚到指定版本,如134

kubectl rollout undo deployments test-service --to-revision=134 -n test

升级历史

kubectl describe deployments test-service  -n test

LEAVE A COMMENT

Captcha Code