# kubectl get rs -l app=nginx NAME DESIRED CURRENT READY AGE nginx-deployment-848bcb569b 3 3 3 5m15s # kubectl get deployment nginx-deployment NAME READY UP-TO-DATE AVAILABLE AGE nginx-deployment 3/3 3 3 6m55s # kubectl get pods -l app=nginx NAME READY STATUS RESTARTS AGE nginx-deployment-848bcb569b-rhhlt 1/1 Running 0 8m16s nginx-deployment-848bcb569b-wp29j 1/1 Running 0 8m16s nginx-deployment-848bcb569b-8nw82 1/1 Running 0 8m16s
# 用户提交一个deployment对象,启用--record并使用rollout实时监控。 # kubectl apply -f deployment.yml --record && kubectl rollout status deployment/nginx-deployment Flag --record has been deprecated, --record will be removed in the future deployment.apps/nginx-deployment created Waiting for deployment "nginx-deployment" rollout to finish: 0 of 3 updated replicas are available... Waiting for deployment "nginx-deployment" rollout to finish: 1 of 3 updated replicas are available... Waiting for deployment "nginx-deployment" rollout to finish: 2 of 3 updated replicas are available... deployment "nginx-deployment" successfully rolled out
$ kubectl describe deployment nginx-deployment ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ScalingReplicaSet 21m deployment-controller Scaled up replica set nginx-deployment-848bcb569b to 3 (原先的3个ReplicaSet 848bcb569b) Normal ScalingReplicaSet 6m58s deployment-controller Scaled up replica set nginx-deployment-69d9dddfd6 to 1 (新建了一个ReplicaSet 69d9dddfd6) Normal ScalingReplicaSet 6m42s deployment-controller Scaled down replica set nginx-deployment-848bcb569b to 2 (删除了一个ReplicaSet 848bcb569b) Normal ScalingReplicaSet 6m42s deployment-controller Scaled up replica set nginx-deployment-69d9dddfd6 to 2 (又新建了一个ReplicaSet 69d9dddfd6) Normal ScalingReplicaSet 6m26s deployment-controller Scaled down replica set nginx-deployment-848bcb569b to 1 (又删除了一个ReplicaSet 848bcb569b) Normal ScalingReplicaSet 6m26s deployment-controller Scaled up replica set nginx-deployment-69d9dddfd6 to 3 (又新建了一个ReplicaSet 69d9dddfd6)