Skip to content

Commit 5bcb2a9

Browse files
Promote STS minReadySeconds to GA
1 parent b522105 commit 5bcb2a9

File tree

3 files changed

+57
-12
lines changed

3 files changed

+57
-12
lines changed

keps/prod-readiness/sig-apps/2599.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ kep-number: 2599
22
alpha:
33
approver: "@ehashman"
44
beta:
5-
approver: "@ehashman"
5+
approver: "@ehashman"
6+
stable:
7+
approver: "@wojtek-t"

keps/sig-apps/2599-minreadyseconds-for-statefulsets/README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ tags, and then generate with `hack/update-toc.sh`.
9191
- [Design Details](#design-details)
9292
- [StatefulSet](#statefulset)
9393
- [Test Plan](#test-plan)
94+
- [Prerequisite testing updates](#prerequisite-testing-updates)
95+
- [Unit tests](#unit-tests)
96+
- [Integration tests](#integration-tests)
97+
- [e2e tests](#e2e-tests)
9498
- [Graduation Criteria](#graduation-criteria)
9599
- [Alpha](#alpha)
96100
- [Alpha -> Beta Graduation](#alpha---beta-graduation)
@@ -261,6 +265,38 @@ Unit, integration and E2E tests cover the existing StatefulSet mechanics.
261265
Additionally, unit and integration tests will be added to cover the
262266
API validation, behavioral change of StatefulSet with feature gate enabled and disabled.
263267

268+
#### Prerequisite testing updates
269+
270+
[x] I/we understand the owners of the involved components may require updates to existing tests to make this code solid enough prior to committing the changes necessary to implement this enhancement.
271+
272+
##### Unit tests
273+
274+
```
275+
`k8s.io/kubernetes/pkg/apis/apps/validation` `06/07/2022`: `90.6% of statements` `The tests added for the current feature in this package touches the statefulSet Spec and Status fields. No new tests are needed for promotion to GA`
276+
`k8s.io/kubernetes/pkg/apis/apps/validation/validation.go:93`: `06/07/2022`: `93.1% of statements`
277+
`k8s.io/kubernetes/pkg/apis/apps/validation/validation.go:162`: `06/07/2022`: `100% of statements`
278+
`k8s.io/kubernetes/pkg/apis/apps/validation/validation.go:169`: `06/07/2022`: `94.1% of statements`
279+
`k8s.io/kubernetes/pkg/apis/apps/validation/validation.go:199`: `06/07/2022`: `100% of statements`
280+
`k8s.io/kubernetes/pkg/controller/statefulset`: `06/07/2022`: `85.5% of statements` `The tests added for the current feature in this package touches the statefulSet upgrade strategies. No new tests are needed for promotion to GA`
281+
`k8s.io/kubernetes/pkg/registry/apps/statefulset`: `06/07/2022`: `76.7% of statements` `The tests added for the current feature in this package makes sure that the kubernetes version upgrades won't have any impact on the new fields to the statefulset api when persisting to etcd. No new tests are needed for promotion to GA`
282+
`k8s.io/kubernetes/pkg/registry/apps/statefulset/strategy.go:95`: `06/07/2022`: `100.0% of statements`
283+
`k8s.io/kubernetes/pkg/registry/apps/statefulset/strategy.go:139`: `06/07/2022`: `100.0% of statements`
284+
`k8s.io/kubernetes/pkg/registry/apps/statefulset/strategy.go:223`: `06/07/2022`: `100.0% of statements`
285+
`k8s.io/kubernetes/pkg/registry/apps/statefulset/strategy.go:118`: `06/07/2022`: `100.0% of statements`
286+
```
287+
288+
##### Integration tests
289+
290+
Added integration tests to test availabile replicas when minReadySeconds is set on the statefulset spec.
291+
292+
k8s.io/kubernetes/test/integration/statefulset.TestStatefulSetAvailable: [test grid](https://testgrid.k8s.io/sig-release-master-blocking#integration-master)
293+
294+
##### e2e tests
295+
296+
Following e2e tests are added to statefulsets.
297+
- StatefulSet MinReadySeconds should be honored when enabled: [test grid](https://storage.googleapis.com/k8s-triage/index.html?sig=apps&test=statefulset)
298+
- StatefulSet AvailableReplicas should get updated accordingly when MinReadySeconds is enabled: [test grid](https://storage.googleapis.com/k8s-triage/index.html?sig=apps&test=statefulset)
299+
264300
### Graduation Criteria
265301

266302
#### Alpha
@@ -273,6 +309,9 @@ API validation, behavioral change of StatefulSet with feature gate enabled and d
273309

274310
#### Beta -> GA Graduation
275311
- 2 examples of end users using this field
312+
- The latest version of [OpenShift](https://github.com/openshift/cluster-monitoring-operator/blob/3ff846fbf36f68ff9aa2145b86ba5fc485398a6b/manifests/0000_50_cluster-monitoring-operator_00_0thanosruler-custom-resource-definition.yaml#L3607) is using this field for cluster monitoring operator
313+
- [Prometheus-operator alert manager](https://github.com/prometheus-operator/prometheus-operator/blob/e45574036f4282c519b64f458d296ca82f455a45/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml#L3549) uses this field
314+
- Other users requesting for this feature can be found in the [github issue](https://github.com/kubernetes/kubernetes/issues/65098)
276315

277316
<!--
278317
**Note:** *Not required until targeted at a release.*
@@ -320,11 +359,12 @@ in back-to-back releases.
320359
- Downgrades
321360
When downgrading from a release with this feature, to a release without
322361
`minReadySeconds`, there are two cases
323-
- If `minReadySeconds` is greater than 0 -- in this case kube-apiserver
324-
clears the `minReadySeconds` and the existing StatefulSets wouldn't honor
325-
`minReadySeconds` which is expected. The same is the case with `AvailableReplicas`
326-
- If `minReadySeconds` is equal to 0 -- in this case user wont see any
327-
difference in behavior
362+
- If `minReadySeconds` is greater than 0 -- the StatefulSet controller wouldn't honor
363+
`minReadySeconds` which is expected. The `AvailableReplicas` will be set to `ReadyReplicas`
364+
by StatefulSet controller
365+
- If `minReadySeconds` is equal to 0 -- in this case user won't see any
366+
difference in behavior. The `AvailableReplicas` will be set to `ReadyReplicas`
367+
by StatefulSet controller
328368

329369
We will ensure that the minReadySeconds field is properly validated
330370
before persisting. The validation includes checking for positive number
@@ -389,7 +429,7 @@ The StatefulSet controller starts respecting the `minReadySeconds` again
389429

390430
###### Are there any tests for feature enablement/disablement?
391431

392-
Yes, unit and integration tests for feature enabled, disabled
432+
Yes, unit and integration tests for feature on, off. Please look at test plan [section](#test-plan)
393433

394434
### Rollout, Upgrade and Rollback Planning
395435

@@ -419,7 +459,7 @@ this metric to track the problems. If the value is immediately equal to the valu
419459

420460
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
421461
Manually tested. No issues were found when we enabled the feature gate -> disabled it ->
422-
re-enabled the feature gate. We still need to test upgrade -> downgrade -> upgrade scenario.
462+
re-enabled the feature gate. Upgrade -> downgrade -> upgrade scenario has been manually tested.
423463
<!--
424464
Describe manual testing that was done and the outcomes.
425465
Longer term, we may want to require automated upgrade/rollback tests, but we

keps/sig-apps/2599-minreadyseconds-for-statefulsets/kep.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@ participating-sigs:
77
- "sig-apps"
88
status: implementable
99
creation-date: 2021-04-07
10-
last-updated: 2021-04-12
10+
last-updated: 2022-06-08
1111
reviewers:
1212
- "@soltysh"
1313
approvers:
1414
- "@soltysh"
1515
prr-approvers:
1616
- "@ehashman"
17+
- "@deads2k"
18+
- "@wojtek-t"
1719
see-also:
1820
- https://github.com/kubernetes/kubernetes/issues/65098
1921

2022

2123
# The target maturity stage in the current dev cycle for this KEP.
22-
stage: beta
24+
stage: stable
2325

2426
# The most recent milestone for which work toward delivery of this KEP has been
2527
# done. This can be the current (upcoming) milestone, if it is being actively
2628
# worked on.
27-
latest-milestone: "v1.23"
29+
latest-milestone: "v1.25"
2830

2931
# The milestone at which this feature was, or is targeted to be, at each stage.
3032
milestone:
@@ -43,4 +45,5 @@ disable-supported: true
4345

4446
# The following PRR answers are required at beta release
4547
metrics:
46-
# - my_feature_metric
48+
- kube_statefulset_status_replicas_available
49+

0 commit comments

Comments
 (0)