Skip to content

Commit ad77b10

Browse files
authored
Merge branch 'kubernetes:master' into kep-hpa-tolerance
2 parents 00ac0eb + 464d254 commit ad77b10

File tree

20 files changed

+127
-38
lines changed

20 files changed

+127
-38
lines changed

api/approval.go

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type PRRApproval struct {
4141
Beta *PRRMilestone `json:"beta" yaml:"beta,omitempty"`
4242
Stable *PRRMilestone `json:"stable" yaml:"stable,omitempty"`
4343
Deprecated *PRRMilestone `json:"deprecated" yaml:"deprecated,omitempty"`
44-
Removed *PRRMilestone `json:"removed", yaml:"removed,omitempty"`
44+
Removed *PRRMilestone `json:"removed" yaml:"removed,omitempty"`
45+
Disabled *PRRMilestone `json:"disabled" yaml:"disabled,omitempty"`
4546

4647
// TODO(api): Move to separate struct for handling document parsing
4748
Error error `json:"-" yaml:"-"`
@@ -61,7 +62,10 @@ func (prr *PRRApproval) ApproverForStage(stage Stage) (string, error) {
6162
return "", err
6263
}
6364

64-
if prr.Alpha == nil && prr.Beta == nil && prr.Stable == nil {
65+
// KEPs are usually of 2 types:
66+
// 1. Features that go through Alpha->Beta->Stable
67+
// 2. Removals that go through Deprecated->Disabled->Removed
68+
if prr.Alpha == nil && prr.Beta == nil && prr.Stable == nil && prr.Deprecated == nil && prr.Disabled == nil && prr.Removed == nil {
6569
return "", ErrPRRMilestonesAllEmpty
6670
}
6771

@@ -70,20 +74,37 @@ func (prr *PRRApproval) ApproverForStage(stage Stage) (string, error) {
7074
if prr.Alpha == nil {
7175
return "", ErrPRRMilestoneIsNil
7276
}
73-
7477
return prr.Alpha.Approver, nil
78+
7579
case BetaStage:
7680
if prr.Beta == nil {
7781
return "", ErrPRRMilestoneIsNil
7882
}
79-
8083
return prr.Beta.Approver, nil
84+
8185
case StableStage:
8286
if prr.Stable == nil {
8387
return "", ErrPRRMilestoneIsNil
8488
}
85-
8689
return prr.Stable.Approver, nil
90+
91+
case Deprecated:
92+
if prr.Deprecated == nil {
93+
return "", ErrPRRMilestoneIsNil
94+
}
95+
return prr.Deprecated.Approver, nil
96+
97+
case Disabled:
98+
if prr.Disabled == nil {
99+
return "", ErrPRRMilestoneIsNil
100+
}
101+
return prr.Disabled.Approver, nil
102+
103+
case Removed:
104+
if prr.Removed == nil {
105+
return "", ErrPRRMilestoneIsNil
106+
}
107+
return prr.Removed.Approver, nil
87108
}
88109

89110
return "", ErrPRRApproverUnknown

api/approval_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ var (
4040
Stable: prrMilestoneWithApprover,
4141
}
4242

43+
validDeprecatedPRR = &api.PRRApproval{
44+
Deprecated: prrMilestoneWithApprover,
45+
}
46+
47+
validDisabledPRR = &api.PRRApproval{
48+
Disabled: prrMilestoneWithApprover,
49+
}
50+
51+
validRemovedPRR = &api.PRRApproval{
52+
Removed: prrMilestoneWithApprover,
53+
}
54+
4355
invalidPRR = &api.PRRApproval{}
4456
)
4557

@@ -85,6 +97,27 @@ func TestPRRApproval_ApproverForStage(t *testing.T) {
8597
wantApprover: "@wojtek-t",
8698
wantErr: false,
8799
},
100+
{
101+
name: "valid: deprecated",
102+
stage: "deprecated",
103+
prr: validDeprecatedPRR,
104+
wantApprover: "@wojtek-t",
105+
wantErr: false,
106+
},
107+
{
108+
name: "valid: disabled",
109+
stage: "disabled",
110+
prr: validDisabledPRR,
111+
wantApprover: "@wojtek-t",
112+
wantErr: false,
113+
},
114+
{
115+
name: "valid: removed",
116+
stage: "removed",
117+
prr: validRemovedPRR,
118+
wantApprover: "@wojtek-t",
119+
wantErr: false,
120+
},
88121
}
89122

90123
for _, tc := range testcases {

api/proposal.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,18 @@ const (
3636
AlphaStage Stage = "alpha"
3737
BetaStage Stage = "beta"
3838
StableStage Stage = "stable"
39+
Deprecated Stage = "deprecated"
40+
Disabled Stage = "disabled"
41+
Removed Stage = "removed"
3942
)
4043

4144
var ValidStages = []Stage{
4245
AlphaStage,
4346
BetaStage,
4447
StableStage,
48+
Deprecated,
49+
Disabled,
50+
Removed,
4551
}
4652

4753
func (s Stage) IsValid() error {
@@ -138,6 +144,7 @@ type Milestone struct {
138144
Stable string `json:"stable" yaml:"stable"`
139145
Deprecated string `json:"deprecated" yaml:"deprecated,omitempty"`
140146
Removed string `json:"removed" yaml:"removed,omitempty"`
147+
Disabled string `json:"disabled" yaml:"disabled,omitempty"`
141148
}
142149

143150
type FeatureGate struct {

keps/NNNN-kep-template/kep.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ replaces:
2222
- "/keps/sig-ccc/3456-replaced-kep"
2323

2424
# The target maturity stage in the current dev cycle for this KEP.
25+
# If the purpose of this KEP is to deprecate a user-visible feature
26+
# and a Deprecated feature gates are added, they should be deprecated|disabled|removed.
2527
stage: alpha|beta|stable
2628

2729
# The most recent milestone for which work toward delivery of this KEP has been
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
kep-number: 3386
22
alpha:
33
approver: "@deads2k"
4-
beta:
5-
approver: "@deads2k"

keps/sig-apps/1847-autoremove-statefulset-pvcs/kep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors:
77
owning-sig: sig-apps
88
participating-sigs:
99
- sig-storage
10-
status: implementable
10+
status: implemented
1111
creation-date: 2020-06-04
1212
reviewers:
1313
- "@kow3ns"

keps/sig-apps/3973-consider-terminating-pods-deployment/README.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Design Details](#design-details)
2020
- [Deployment Behavior Changes](#deployment-behavior-changes)
2121
- [ReplicaSet Status and Deployment Status Changes](#replicaset-status-and-deployment-status-changes)
22+
- [Deployment Completion and Progress Changes](#deployment-completion-and-progress-changes)
2223
- [Deployment Scaling Changes and a New Annotation for ReplicaSets](#deployment-scaling-changes-and-a-new-annotation-for-replicasets)
2324
- [kubectl Changes](#kubectl-changes)
2425
- [API](#api)
@@ -279,6 +280,20 @@ To satisfy the requirement for tracking terminating pods, and for implementation
279280
we propose a new field `.status.terminatingReplicas` to the ReplicaSet's and Deployment's
280281
status.
281282

283+
### Deployment Completion and Progress Changes
284+
285+
Currently, when the latest ReplicaSet is fully saturated and all of its pods become available, the
286+
Deployment is declared complete. However, there may still be old terminating pods. These pods can
287+
still be ready and hold/accept connections, meaning that the transition to the latest revision is
288+
not fully complete.
289+
290+
To avoid unexpected behavior, we should not declare the deployment complete until all of its
291+
terminating replicas have been fully terminated. We will therefore delay setting a `NewRSAvailable`
292+
reason to the `DeploymentProgressing` condition, when `TerminationComplete` policy is used.
293+
294+
We will also update the `LastUpdateTime` of the `DeploymentProgressing` condition when the number of
295+
terminating pods decreases to reset the progress deadline.
296+
282297
### Deployment Scaling Changes and a New Annotation for ReplicaSets
283298

284299
Currently, scaling is done proportionally over all ReplicaSets to mitigate the risk of losing
@@ -383,14 +398,17 @@ See [kubectl Skew](#kubectl-skew) for more details.
383398
type DeploymentPodReplacementPolicy string
384399
const (
385400
// TerminationStarted policy creates replacement Pods when the old Pods start
386-
// terminating (has a .metadata.deletionTimestamp). The total number of
387-
// Deployment Pods can be greater than specified by the Deployment's
401+
// terminating (have a non-null .metadata.deletionTimestamp). The total number
402+
// of Deployment Pods can be greater than specified by the Deployment's
388403
// .spec.replicas and the DeploymentStrategy.
389404
TerminationStarted DeploymentPodReplacementPolicy = "TerminationStarted"
390405
// TerminationComplete policy creates replacement Pods only when the old Pods
391406
// are fully terminated (reach Succeeded or Failed phase). The old Pods are
392407
// subsequently removed. The total number of the Deployment Pods is
393408
// limited by the Deployment's .spec.replicas and the DeploymentStrategy.
409+
//
410+
// This policy will also delay declaring the deployment as complete until all
411+
// of its terminating replicas have been fully terminated.
394412
TerminationComplete DeploymentPodReplacementPolicy = "TerminationComplete"
395413
)
396414
```
@@ -401,13 +419,15 @@ type DeploymentSpec struct {
401419
// podReplacementPolicy specifies when to create replacement Pods.
402420
// Possible values are:
403421
// - TerminationStarted policy creates replacement Pods when the old Pods start
404-
// terminating (has a .metadata.deletionTimestamp). The total number of
405-
// Deployment Pods can be greater than specified by the Deployment's
422+
// terminating (have a non-null .metadata.deletionTimestamp). The total number
423+
// of Deployment Pods can be greater than specified by the Deployment's
406424
// .spec.replicas and the DeploymentStrategy.
407425
// - TerminationComplete policy creates replacement Pods only when the old Pods
408426
// are fully terminated (reach Succeeded or Failed phase). The old Pods are
409427
// subsequently removed. The total number of the Deployment Pods is
410428
// limited by the Deployment's .spec.replicas and the DeploymentStrategy.
429+
// This policy will also delay declaring the deployment as complete until all
430+
// of its terminating replicas have been fully terminated.
411431
//
412432
// The default behavior when the policy is not specified depends on the DeploymentStrategy:
413433
// - Recreate strategy uses TerminationComplete behavior when recreating the deployment,
@@ -442,11 +462,11 @@ type ReplicaSetStatus struct {
442462
// +optional
443463
AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"`
444464

445-
// The number of terminating replicas (have .metadata.deletionTimestamp) for this replica set.
465+
// The number of terminating pods (have a non-null .metadata.deletionTimestamp) for this replica set.
446466
//
447467
// This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.
448468
// +optional
449-
TerminatingReplicas int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"`
469+
TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"`
450470
...
451471
}
452472
```
@@ -476,11 +496,11 @@ type DeploymentStatus struct {
476496
// +optional
477497
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"`
478498

479-
// Total number of terminating pods (have .metadata.deletionTimestamp) targeted by this deployment.
499+
// Total number of terminating pods (have a non-null .metadata.deletionTimestamp) targeted by this deployment.
480500
//
481501
// This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.
482502
// +optional
483-
TerminatingReplicas int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"`
503+
TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"`
484504
...
485505
}
486506
```
@@ -929,6 +949,7 @@ deployment and replicaset controllers.
929949
- 2023-05-01: First version of the KEP opened (https://github.com/kubernetes/enhancements/pull/3974).
930950
- 2023-12-12: Second version of the KEP opened (https://github.com/kubernetes/enhancements/pull/4357).
931951
- 2024-29-05: Added a Deployment Scaling Changes and a New Annotation for ReplicaSets section (https://github.com/kubernetes/enhancements/pull/4670).
952+
- 2024-22-11: Added a Deployment Completion and Progress Changes section (https://github.com/kubernetes/enhancements/pull/4976).
932953

933954
## Drawbacks
934955

keps/sig-apps/3973-consider-terminating-pods-deployment/kep.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ stage: alpha
2222
# The most recent milestone for which work toward delivery of this KEP has been
2323
# done. This can be the current (upcoming) milestone, if it is being actively
2424
# worked on.
25-
latest-milestone: "v1.32"
25+
latest-milestone: "v1.33"
2626

2727
# The milestone at which this feature was, or is targeted to be, at each stage.
2828
milestone:
29-
alpha: "v1.32"
29+
alpha: "v1.33"
3030
beta: ""
3131
stable: ""
3232

keps/sig-apps/4026-crojob-scheduled-timestamp-annotation/kep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors:
55
- "@soltysh"
66
owning-sig: sig-apps
77
participating-sigs:
8-
status: implementable
8+
status: implemented
99
creation-date: 2023-06-06
1010
reviewers:
1111
- "@soltysh"

keps/sig-auth/4193-bound-service-account-token-improvements/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ For example, attempting to issue a node bound token, or attempting to authentica
724724
* `ServiceAccountTokenJTI`, `ServiceAccountTokenNodeBindingValidation` and `ServiceAccountTokenPodNodeInfo` promoted to beta for v1.30 release
725725
* Promoted `ServiceAccountTokenNodeBinding` promoted to beta for v1.31 release
726726
* Promoted `ServiceAccountTokenJTI`, `ServiceAccountTokenPodNodeInfo`, `ServiceAccountTokenNodeBindingValidation` to stable for v1.32 release
727+
* Promoted `ServiceAccountTokenNodeBinding` to stable for v1.33 release
727728

728729
<!--
729730
Major milestones in the lifecycle of a KEP should be tracked in this section.

0 commit comments

Comments
 (0)