Skip to content

Commit c93f096

Browse files
authored
Merge pull request #31226 from atiratree/concepts.deployment
make deployment status behaviour more descriptive
2 parents abac6d2 + 8f8d2bb commit c93f096

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

content/en/docs/concepts/workloads/controllers/deployment.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,13 @@ Kubernetes marks a Deployment as _progressing_ when one of the following tasks i
842842
* The Deployment is scaling down its older ReplicaSet(s).
843843
* New Pods become ready or available (ready for at least [MinReadySeconds](#min-ready-seconds)).
844844
845+
When the rollout becomes “progressing”, the Deployment controller adds a condition with the following
846+
attributes to the Deployment's `.status.conditions`:
847+
848+
* `type: Progressing`
849+
* `status: "True"`
850+
* `reason: NewReplicaSetCreated` | `reason: FoundNewReplicaSet` | `reason: ReplicaSetUpdated`
851+
845852
You can monitor the progress for a Deployment by using `kubectl rollout status`.
846853

847854
### Complete Deployment
@@ -853,6 +860,17 @@ updates you've requested have been completed.
853860
* All of the replicas associated with the Deployment are available.
854861
* No old replicas for the Deployment are running.
855862

863+
When the rollout becomes “complete”, the Deployment controller sets a condition with the following
864+
attributes to the Deployment's `.status.conditions`:
865+
866+
* `type: Progressing`
867+
* `status: "True"`
868+
* `reason: NewReplicaSetAvailable`
869+
870+
This `Progressing` condition will retain a status value of `"True"` until a new rollout
871+
is initiated. The condition holds even when availability of replicas changes (which
872+
does instead affect the `Available` condition).
873+
856874
You can check if a Deployment has completed by using `kubectl rollout status`. If the rollout completed
857875
successfully, `kubectl rollout status` returns a zero exit code.
858876
@@ -890,7 +908,7 @@ number of seconds the Deployment controller waits before indicating (in the Depl
890908
Deployment progress has stalled.
891909
892910
The following `kubectl` command sets the spec with `progressDeadlineSeconds` to make the controller report
893-
lack of progress for a Deployment after 10 minutes:
911+
lack of progress of a rollout for a Deployment after 10 minutes:
894912
895913
```shell
896914
kubectl patch deployment/nginx-deployment -p '{"spec":{"progressDeadlineSeconds":600}}'
@@ -902,15 +920,18 @@ deployment.apps/nginx-deployment patched
902920
Once the deadline has been exceeded, the Deployment controller adds a DeploymentCondition with the following
903921
attributes to the Deployment's `.status.conditions`:
904922

905-
* Type=Progressing
906-
* Status=False
907-
* Reason=ProgressDeadlineExceeded
923+
* `type: Progressing`
924+
* `status: "False"`
925+
* `reason: ProgressDeadlineExceeded`
926+
927+
This condition can also fail early and is then set to status value of `"False"` due to reasons as `ReplicaSetCreateError`.
928+
Also, the deadline is not taken into account anymore once the Deployment rollout completes.
908929

909930
See the [Kubernetes API conventions](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) for more information on status conditions.
910931

911932
{{< note >}}
912933
Kubernetes takes no action on a stalled Deployment other than to report a status condition with
913-
`Reason=ProgressDeadlineExceeded`. Higher level orchestrators can take advantage of it and act accordingly, for
934+
`reason: ProgressDeadlineExceeded`. Higher level orchestrators can take advantage of it and act accordingly, for
914935
example, rollback the Deployment to its previous version.
915936
{{< /note >}}
916937

@@ -984,7 +1005,7 @@ Conditions:
9841005
You can address an issue of insufficient quota by scaling down your Deployment, by scaling down other
9851006
controllers you may be running, or by increasing quota in your namespace. If you satisfy the quota
9861007
conditions and the Deployment controller then completes the Deployment rollout, you'll see the
987-
Deployment's status update with a successful condition (`Status=True` and `Reason=NewReplicaSetAvailable`).
1008+
Deployment's status update with a successful condition (`status: "True"` and `reason: NewReplicaSetAvailable`).
9881009
9891010
```
9901011
Conditions:
@@ -994,11 +1015,11 @@ Conditions:
9941015
Progressing True NewReplicaSetAvailable
9951016
```
9961017
997-
`Type=Available` with `Status=True` means that your Deployment has minimum availability. Minimum availability is dictated
998-
by the parameters specified in the deployment strategy. `Type=Progressing` with `Status=True` means that your Deployment
1018+
`type: Available` with `status: "True"` means that your Deployment has minimum availability. Minimum availability is dictated
1019+
by the parameters specified in the deployment strategy. `type: Progressing` with `status: "True"` means that your Deployment
9991020
is either in the middle of a rollout and it is progressing or that it has successfully completed its progress and the minimum
10001021
required new replicas are available (see the Reason of the condition for the particulars - in our case
1001-
`Reason=NewReplicaSetAvailable` means that the Deployment is complete).
1022+
`reason: NewReplicaSetAvailable` means that the Deployment is complete).
10021023
10031024
You can check if a Deployment has failed to progress by using `kubectl rollout status`. `kubectl rollout status`
10041025
returns a non-zero exit code if the Deployment has exceeded the progression deadline.
@@ -1155,8 +1176,8 @@ total number of Pods running at any time during the update is at most 130% of de
11551176
11561177
`.spec.progressDeadlineSeconds` is an optional field that specifies the number of seconds you want
11571178
to wait for your Deployment to progress before the system reports back that the Deployment has
1158-
[failed progressing](#failed-deployment) - surfaced as a condition with `Type=Progressing`, `Status=False`.
1159-
and `Reason=ProgressDeadlineExceeded` in the status of the resource. The Deployment controller will keep
1179+
[failed progressing](#failed-deployment) - surfaced as a condition with `type: Progressing`, `status: "False"`.
1180+
and `reason: ProgressDeadlineExceeded` in the status of the resource. The Deployment controller will keep
11601181
retrying the Deployment. This defaults to 600. In the future, once automatic rollback will be implemented, the Deployment
11611182
controller will roll back a Deployment as soon as it observes such a condition.
11621183

0 commit comments

Comments
 (0)