1.简介
当一个pod部署之后,镜像有新的版本,希望滚动升级pod,使用新版本镜像
2.配置镜像拉取策略
spec:
containers:
- image: xxxxxx
imagePullPolicy: Always
name: macroverse-web
ports:
- 配置镜像拉取策略为Always
3.设置新的镜像版本
kubectl set image deployment/<deployment=name> <image-name>=<new-image-version> -n <namespace>
deployment.apps/macroverse-web image updated
4.检查升级状态
kubectl get pods -n macroverse --watch
NAME READY STATUS RESTARTS AGE
macroverse-web-64c4658498-mxxr9 1/1 Running 0 7h59m
macroverse-web-c9dffcd5-vkd54 0/1 Pending 0 65s
macroverse-web-c9dffcd5-vkd54 0/1 Pending 0 96s
macrovers