$ k apply -f nginx-deploy.yml deployment.apps/nginx-deploy created
$ k get deployments.apps -owide NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR nginx-deploy 2/2 2 2 23s nginx nginx:alpine app=nginx-deploy
$ k get rs NAME DESIRED CURRENT READY AGE nginx-deploy-5db48f768c 2 2 2 51s
$ k get po -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES nginx-deploy-5db48f768c-84f4q 1/1 Running 0 66s 10.10.1.33 mac-worker <none> <none> nginx-deploy-5db48f768c-bmqwj 1/1 Running 0 66s 10.10.1.32 mac-worker <none> <none>
$ k scale --replicas=3 deployment nginx-deploy deployment.apps/nginx-deploy scaled
$ k get po -l app=nginx-deploy NAME READY STATUS RESTARTS AGE nginx-deploy-5db48f768c-4pd6w 1/1 Running 0 10m nginx-deploy-5db48f768c-88k88 1/1 Running 0 31s nginx-deploy-5db48f768c-bmqwj 1/1 Running 0 14m
$ k get rs -w NAME DESIRED CURRENT READY AGE nginx-deploy-5db48f768c 2 2 2 13m nginx-deploy-5db48f768c 3 2 2 14m nginx-deploy-5db48f768c 3 2 2 14m nginx-deploy-5db48f768c 3 3 2 14m nginx-deploy-5db48f768c 3 3 3 14m
$ k get po -w NAME READY STATUS RESTARTS AGE nginx-deploy-5db48f768c-4pd6w 1/1 Running 0 10m nginx-deploy-5db48f768c-bmqwj 1/1 Running 0 13m nginx-deploy-5db48f768c-88k88 0/1 Pending 0 0s nginx-deploy-5db48f768c-88k88 0/1 Pending 0 0s nginx-deploy-5db48f768c-88k88 0/1 ContainerCreating 0 0s nginx-deploy-5db48f768c-88k88 1/1 Running 0 1s
$ k describe rs nginx-deploy-5db48f768c Name: nginx-deploy-5db48f768c Namespace: default Selector: app=nginx-deploy,pod-template-hash=5db48f768c Labels: app=nginx-deploy pod-template-hash=5db48f768c Annotations: deployment.kubernetes.io/desired-replicas: 3 deployment.kubernetes.io/max-replicas: 4 deployment.kubernetes.io/revision: 1 Controlled By: Deployment/nginx-deploy Replicas: 3 current / 3 desired Pods Status: 3 Running / 0 Waiting / 0 Succeeded / 0 Failed Pod Template: Labels: app=nginx-deploy pod-template-hash=5db48f768c Containers: nginx: Image: nginx:alpine Port: <none> Host Port: <none> Environment: <none> Mounts: <none> Volumes: <none> Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal SuccessfulCreate 16m replicaset-controller Created pod: nginx-deploy-5db48f768c-bmqwj Normal SuccessfulCreate 16m replicaset-controller Created pod: nginx-deploy-5db48f768c-84f4q Normal SuccessfulCreate 12m replicaset-controller Created pod: nginx-deploy-5db48f768c-4pd6w Normal SuccessfulCreate 2m4s replicaset-controller Created pod: nginx-deploy-5db48f768c-88k88
$ k describe deployments.apps nginx-deploy Name: nginx-deploy Namespace: default CreationTimestamp: Sat, 17 Jun 2022 15:12:59 +0000 Labels: app=nginx-deploy Annotations: deployment.kubernetes.io/revision: 1 Selector: app=nginx-deploy Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 25% max unavailable, 25% max surge Pod Template: Labels: app=nginx-deploy Containers: nginx: Image: nginx:alpine Port: <none> Host Port: <none> Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Progressing True NewReplicaSetAvailable Available True MinimumReplicasAvailable OldReplicaSets: <none> NewReplicaSet: nginx-deploy-5db48f768c (3/3 replicas created) Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ScalingReplicaSet 15m deployment-controller Scaled up replica set nginx-deploy-5db48f768c to 2 Normal ScalingReplicaSet 80s deployment-controller Scaled up replica set nginx-deploy-5db48f768c to 3
$ k describe deployments.apps nginx-deploy Name: nginx-deploy Namespace: default CreationTimestamp: Sat, 17 Jun 2022 15:12:59 +0000 Labels: app=nginx-deploy Annotations: deployment.kubernetes.io/revision: 2 Selector: app=nginx-deploy Replicas: 2 desired | 2 updated | 2 total | 2 available | 0 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 25% max unavailable, 25% max surge Pod Template: Labels: app=nginx-deploy Containers: nginx: Image: nginx:alpine Port: <none> Host Port: <none> Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Available True MinimumReplicasAvailable Progressing True NewReplicaSetAvailable OldReplicaSets: <none> NewReplicaSet: nginx-deploy-676b7b47d4 (2/2 replicas created) Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ScalingReplicaSet 23m deployment-controller Scaled up replica set nginx-deploy-5db48f768c to 2 Normal ScalingReplicaSet 9m7s deployment-controller Scaled up replica set nginx-deploy-5db48f768c to 3 Normal ScalingReplicaSet 94s deployment-controller Scaled down replica set nginx-deploy-5db48f768c to 2 Normal ScalingReplicaSet 94s deployment-controller Scaled up replica set nginx-deploy-676b7b47d4 to 1 Normal ScalingReplicaSet 93s deployment-controller Scaled down replica set nginx-deploy-5db48f768c to 1 Normal ScalingReplicaSet 93s deployment-controller Scaled up replica set nginx-deploy-676b7b47d4 to 2 Normal ScalingReplicaSet 92s deployment-controller Scaled down replica set nginx-deploy-5db48f768c to 0