Skip to content

Commit 4e095b9

Browse files
authored
Merge pull request kubernetes#3408 from psschwei/kep-2238-update
Updates kep-2238 for v1.25
2 parents d44c51c + 6270ce1 commit 4e095b9

File tree

2 files changed

+69
-20
lines changed

2 files changed

+69
-20
lines changed

keps/sig-node/2238-liveness-probe-grace-period/README.md

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
- [Risks and Mitigations](#risks-and-mitigations)
1212
- [Design Details](#design-details)
1313
- [Test Plan](#test-plan)
14+
- [Prerequisite testing updates](#prerequisite-testing-updates)
15+
- [Unit tests](#unit-tests)
16+
- [Integration tests](#integration-tests)
17+
- [e2e tests](#e2e-tests)
1418
- [Graduation Criteria](#graduation-criteria)
1519
- [Alpha (1.21)](#alpha-121)
1620
- [Beta (1.22)](#beta-122)
17-
- [Graduation (1.25)](#graduation-125)
21+
- [Graduation (1.27)](#graduation-127)
1822
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
1923
- [Version Skew Strategy](#version-skew-strategy)
2024
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
@@ -33,16 +37,21 @@
3337

3438
Items marked with (R) are required *prior to targeting to a milestone / release*.
3539

36-
- [X] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
37-
- [X] (R) KEP approvers have approved the KEP status as `implementable`
38-
- [X] (R) Design details are appropriately documented
39-
- [X] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
40-
- [X] (R) Graduation criteria is in place
41-
- [X] (R) Production readiness review completed
42-
- [X] (R) Production readiness review approved
43-
- [X] "Implementation History" section is up-to-date for milestone
44-
- [X] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
45-
- [X] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
40+
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
41+
- [x] (R) KEP approvers have approved the KEP status as `implementable`
42+
- [x] (R) Design details are appropriately documented
43+
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
44+
- [x] e2e Tests for all Beta API Operations (endpoints)
45+
- [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
46+
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
47+
- [x] (R) Graduation criteria is in place
48+
- [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
49+
- [x] (R) Production readiness review completed
50+
- [x] (R) Production readiness review approved
51+
- [x] "Implementation History" section is up-to-date for milestone
52+
- [x] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
53+
- [x] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
54+
4655

4756
[kubernetes.io]: https://kubernetes.io/
4857
[kubernetes/enhancements]: https://git.k8s.io/enhancements
@@ -149,7 +158,8 @@ This field is not valid for readiness probes. We will add validation to ensure
149158

150159
We expect that the `livenessProbe.terminationGracePeriodSeconds` (or
151160
`startupProbe.*`) will not be greater than the pod-level
152-
`terminationGracePeriodSeconds`, but we will not explicitly validate this.
161+
`terminationGracePeriodSeconds`, but we will not explicitly validate this (we will
162+
perform a soft validation and log when this condition occurs).
153163

154164
`initialDelaySeconds` is not relevant to this value; it indicates how long we
155165
should wait before probing the container, but does not have any relation to how
@@ -168,6 +178,12 @@ down upon failure.
168178

169179
### Test Plan
170180

181+
[x] I/we understand the owners of the involved components may require updates to
182+
existing tests to make this code solid enough prior to committing the changes necessary
183+
to implement this enhancement.
184+
185+
#### Prerequisite testing updates
186+
171187
This change will be unit tested for the API changes and
172188
backwards-compatibility.
173189

@@ -181,6 +197,40 @@ large value, a probe fails, and with
181197
`livenessProbe.terminationGracePeriodSeconds` set, the container terminates
182198
quickly.
183199

200+
Update `test/e2e_node/eviction_test.go` to include pods with probes that have this feature
201+
set to ensure the feature causes no issues with pod eviction and that the eviction
202+
process doesn't interfere with the grace period for pods not being evicted.
203+
204+
#### Unit tests
205+
206+
Coverage prior to merging:
207+
208+
- `pkg/api/pod`: 2021-03-11 - 54.8% of statements
209+
- `pkg/apis/core/validation`: 2021-03-11 - 81.0% of statements
210+
- `pkg/kubelet/kuberuntime`: 2021-03-11 - 65.2% of statements
211+
212+
(these numbers were obtained by checking out the prior commit [`7b7c842eeccf5da90607abf6ec7c59935fe828ef`](https://github.com/kubernetes/kubernetes/tree/7b7c842eeccf5da90607abf6ec7c59935fe828ef) and running `go test -cover` against it)
213+
214+
Coverage after merging:
215+
216+
- `pkg/api/pod`: 57.0% of statements - increase of 2.2%
217+
- `pkg/apis/core/validation`: 81.0% of statements - no change in coverage
218+
- `pkg/kubelet/kuberuntime`: 65.0% of statements - decrease of 0.2%
219+
220+
(these numbers were obtained by checking out the commit after the code had merged [06e634e2162b16e2196395e3a232c01a558f0463](https://github.com/kubernetes/kubernetes/tree/06e634e2162b16e2196395e3a232c01a558f0463) and running `go test -cover` against it)
221+
222+
Unit buckets need to be added to `TestKillContainer` to test the [various scenarios and sequences](https://github.com/kubernetes/kubernetes/blob/02462739ca544dc61f4bf00a290d247c453030ef/pkg/kubelet/kuberuntime/kuberuntime_container.go#L683-L695) for setting the grace period from the various `terminationGracePeriodSeconds` values
223+
224+
#### Integration tests
225+
226+
- Set terminationGracePeriodSeconds for livenessProbe: [link to test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20override%20timeoutGracePeriodSeconds%20when%20LivenessProbe%20field%20is%20set%20%5BFeature%3AProbeTerminationGracePeriod%5D)
227+
- Set terminationGracePeriodSeconds for startupProbe: [link to test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20override%20timeoutGracePeriodSeconds%20when%20StartupProbe%20field%20is%20set%20%5BFeature%3AProbeTerminationGracePeriod%5D)
228+
229+
#### e2e tests
230+
231+
- Set terminationGracePeriodSeconds for livenessProbe: [link to test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20override%20timeoutGracePeriodSeconds%20when%20LivenessProbe%20field%20is%20set%20%5BFeature%3AProbeTerminationGracePeriod%5D)
232+
- Set terminationGracePeriodSeconds for startupProbe: [link to test coverage](https://storage.googleapis.com/k8s-triage/index.html?test=should%20override%20timeoutGracePeriodSeconds%20when%20StartupProbe%20field%20is%20set%20%5BFeature%3AProbeTerminationGracePeriod%5D)
233+
184234
### Graduation Criteria
185235

186236
#### Alpha (1.21)
@@ -196,14 +246,14 @@ quickly.
196246
- Ensure that when feature gate is off in API server, probe-level
197247
`TerminationGracePeriodSeconds` is blanked out.
198248
- Add validation to ensure `terminationGracePeriodSeconds` is non-negative.
199-
- Feature flag is defaulted to on after kube-apiserver is +2 versions of the
200-
kubelet having the support (1.24).
249+
- Feature flag is defaulted to on after kube-apiserver is +3 versions of the
250+
kubelet having the support (1.25).
201251

202252
_Below graduation criteria are tentative._
203253

204-
#### Graduation (1.25)
254+
#### Graduation (1.27)
205255

206-
- Feature flag is removed, feature is graduated (1.25).
256+
- Feature flag is removed, feature is graduated (1.27).
207257

208258
### Upgrade / Downgrade Strategy
209259

@@ -242,8 +292,8 @@ enhancement:
242292
n-2 kubelet without this feature will default to the old behaviour, using the
243293
pod-level `terminationGracePeriodSeconds`.
244294

245-
Feature gate will be removed from kubelet in 1.22, ensuring support for n-2
246-
version skew on a 1.24+ API server.
295+
Feature gate will be removed from kubelet in 1.25, ensuring support for n-2
296+
version skew on a 1.27+ API server.
247297

248298
Only when feature gate is enabled for all components will we use the new field,
249299
so we delay defaulting the feature flag on until then.

keps/sig-node/2238-liveness-probe-grace-period/kep.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ reviewers:
1414
- "@smarterclayton"
1515
approvers:
1616
- "@derekwaynecarr"
17-
prr-approvers:
18-
- "@johnbelamaric"
1917

2018
# The target maturity stage in the current dev cycle for this KEP.
2119
stage: beta
@@ -38,3 +36,4 @@ feature-gates:
3836
components:
3937
- kube-apiserver
4038
disable-supported: true
39+

0 commit comments

Comments
 (0)