Skip to content

Commit 5aeea45

Browse files
authored
Merge pull request kubernetes#128546 from atiratree/pod-replacement-policy-terminating-pods
add PodReplacementPolicy for Deployments: terminating pods
2 parents 9635a25 + e263b87 commit 5aeea45

File tree

78 files changed

+2223
-910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2223
-910
lines changed

api/openapi-spec/swagger.json

Lines changed: 21 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/apis__apps__v1_openapi.json

Lines changed: 21 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/apps/types.go

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -507,19 +507,19 @@ type DeploymentStatus struct {
507507
// +optional
508508
ObservedGeneration int64
509509

510-
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
510+
// Total number of non-terminating pods targeted by this deployment (their labels match the selector).
511511
// +optional
512512
Replicas int32
513513

514-
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
514+
// Total number of non-terminating pods targeted by this deployment that have the desired template spec.
515515
// +optional
516516
UpdatedReplicas int32
517517

518-
// Total number of ready pods targeted by this deployment.
518+
// Total number of non-terminating pods targeted by this Deployment with a Ready Condition.
519519
// +optional
520520
ReadyReplicas int32
521521

522-
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
522+
// Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.
523523
// +optional
524524
AvailableReplicas int32
525525

@@ -529,6 +529,13 @@ type DeploymentStatus struct {
529529
// +optional
530530
UnavailableReplicas int32
531531

532+
// Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
533+
// .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
534+
//
535+
// This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.
536+
// +optional
537+
TerminatingReplicas *int32
538+
532539
// Represents the latest available observations of a deployment's current state.
533540
Conditions []DeploymentCondition
534541

@@ -865,22 +872,30 @@ type ReplicaSetSpec struct {
865872

866873
// ReplicaSetStatus represents the current status of a ReplicaSet.
867874
type ReplicaSetStatus struct {
868-
// Replicas is the number of actual replicas.
875+
// Replicas is the most recently observed number of non-terminating pods.
876+
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset
869877
Replicas int32
870878

871-
// The number of pods that have labels matching the labels of the pod template of the replicaset.
879+
// The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.
872880
// +optional
873881
FullyLabeledReplicas int32
874882

875-
// The number of ready replicas for this replica set.
883+
// The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.
876884
// +optional
877885
ReadyReplicas int32
878886

879-
// The number of available replicas (ready for at least minReadySeconds) for this replica set.
887+
// The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.
880888
// +optional
881889
AvailableReplicas int32
882890

883-
// ObservedGeneration is the most recent generation observed by the controller.
891+
// The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp
892+
// and have not yet reached the Failed or Succeeded .status.phase.
893+
//
894+
// This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.
895+
// +optional
896+
TerminatingReplicas *int32
897+
898+
// ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
884899
// +optional
885900
ObservedGeneration int64
886901

pkg/apis/apps/v1/zz_generated.conversion.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/apps/v1beta1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/apps/v1beta2/zz_generated.conversion.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)