[root@master ~]# kubectl set image deployment hellohttp hellohttp=registry.cn-hangzhou.aliyuncs.com/myluzh/hellohttp:v2-error --record
Flag --record has been deprecated, --record will be removed in the future
deployment.apps/hellohttp image updated
#查看历史版本
[root@master ~]# kubectl rollout history deployment hellohttp
deployment.apps/hellohttp
REVISION CHANGE-CAUSE
3 <none>
4 kubectl set image deployment hellohttp hellohttp=registry.cn-hangzhou.aliyuncs.com/myluzh/hellohttp:v2-error --record=true
2.查看pod状态
查看pod状态,可以看到旧版本pod在关闭
[root@master hellohttp]# kubectl get pod
NAME READY STATUS RESTARTS AGE
hellohttp-564dbb8b9d-269xj 1/1 Running 0 18s
hellohttp-564dbb8b9d-cgfnm 1/1 Running 0 12s
hellohttp-78c5857bbd-5v6m6 1/1 Terminating 0 26m
hellohttp-78c5857bbd-b4jg4 1/1 Terminating 0 26m
发表评论