Waiting for deployment "test" rollout to finish: 1 out of 3 new replicas have been updated... Waiting for deployment "test" rollout to finish: 1 out of 3 new replicas have been updated... Waiting for deployment "test" rollout to finish: 1 out of 3 new replicas have been updated... Waiting for deployment "test" rollout to finish: 2 out of 3 new replicas have been updated... Waiting for deployment "test" rollout to finish: 2 out of 3 new replicas have been updated... Waiting for deployment "test" rollout to finish: 2 out of 3 new replicas have been updated... Waiting for deployment "test" rollout to finish: 1 old replicas are pending termination... Waiting for deployment "test" rollout to finish: 1 old replicas are pending termination... deployment "test" successfully rolled out
再查看一次此 Deployment 與其他資源的關係。
1 2 3 4 5 6 7 8
kubectl tree deployment test NAMESPACE NAME READY REASON AGE default Deployment/test - 7h57m default ├─ReplicaSet/test-5678b9ddb4 - 4m39s default │ ├─Pod/test-5678b9ddb4-4b5f6 True 4m39s default │ ├─Pod/test-5678b9ddb4-5dl6p True 81s default │ └─Pod/test-5678b9ddb4-67pv9 True 3m10s default └─ReplicaSet/test-5db5984bbf - 7h57m
會有一個新的 ReplicaSet 生成,而所有的 Pod 完成更新。
滾動降級版本
使用 kubectl rollout undo 指令,把 Pod 從新的 ReplicaSet 轉移回舊的 ReplicaSet。
1
kubectl rollout undo deployment test
查看此 Deployment 與其他資源的關係。
1 2 3 4 5 6 7 8
kubectl tree deployment test NAMESPACE NAME READY REASON AGE default Deployment/test - 8h default ├─ReplicaSet/test-5678b9ddb4 - 10m default └─ReplicaSet/test-5db5984bbf - 8h default ├─Pod/test-5db5984bbf-f5crq True 2m3s default ├─Pod/test-5db5984bbf-ff4px True 115s default └─Pod/test-5db5984bbf-w8d5q True 2m11s