Skip to content

Commit 21f3345

Browse files
KEP 4818: Promote zero value for Pod Lifecycle Sleep action to beta
1 parent 914f79b commit 21f3345

File tree

3 files changed

+24
-130
lines changed

3 files changed

+24
-130
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kep-number: 4818
22
alpha:
3-
approver: "@wojtek-t"
3+
approver: "@wojtek-t"
4+
beta:
5+
approver: ""

keps/sig-node/4818-allow-zero-value-for-sleep-action-of-prestop-hook/README.md

Lines changed: 17 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,5 @@
1-
<!--
2-
**Note:** When your KEP is complete, all of these comment blocks should be removed.
3-
4-
To get started with this template:
5-
6-
- [x] **Pick a hosting SIG.**
7-
Make sure that the problem space is something the SIG is interested in taking
8-
up. KEPs should not be checked in without a sponsoring SIG.
9-
- [x] **Create an issue in kubernetes/enhancements**
10-
When filing an enhancement tracking issue, please make sure to complete all
11-
fields in that template. One of the fields asks for a link to the KEP. You
12-
can leave that blank until this KEP is filed, and then go back to the
13-
enhancement and add the link.
14-
- [x] **Make a copy of this template directory.**
15-
Copy this template into the owning SIG's directory and name it
16-
`NNNN-short-descriptive-title`, where `NNNN` is the issue number (with no
17-
leading-zero padding) assigned to your enhancement above.
18-
- [x] **Fill out as much of the kep.yaml file as you can.**
19-
At minimum, you should fill in the "Title", "Authors", "Owning-sig",
20-
"Status", and date-related fields.
21-
- [x] **Fill out this file as best you can.**
22-
At minimum, you should fill in the "Summary" and "Motivation" sections.
23-
These should be easy if you've preflighted the idea of the KEP with the
24-
appropriate SIG(s).
25-
- [x] **Create a PR for this KEP.**
26-
Assign it to people in the SIG who are sponsoring this process.
27-
- [ ] **Merge early and iterate.**
28-
Avoid getting hung up on specific details and instead aim to get the goals of
29-
the KEP clarified and merged quickly. The best way to do this is to just
30-
start with the high-level sections and fill out details incrementally in
31-
subsequent PRs.
32-
33-
Just because a KEP is merged does not mean it is complete or approved. Any KEP
34-
marked as `provisional` is a working document and subject to change. You can
35-
denote sections that are under active debate as follows:
36-
37-
```
38-
<<[UNRESOLVED optional short context or usernames ]>>
39-
Stuff that is being argued.
40-
<<[/UNRESOLVED]>>
41-
```
42-
43-
When editing KEPS, aim for tightly-scoped, single-topic PRs to keep discussions
44-
focused. If you disagree with what is already in a document, open a new PR
45-
with suggested changes.
46-
47-
One KEP corresponds to one "feature" or "enhancement" for its whole lifecycle.
48-
You do not need a new KEP to move from beta to GA, for example. If
49-
new details emerge that belong in the KEP, edit the KEP. Once a feature has become
50-
"implemented", major changes should get new KEPs.
51-
52-
The canonical place for the latest set of instructions (and the likely source
53-
of this file) is [here](/keps/NNNN-kep-template/README.md).
54-
55-
**Note:** Any PRs to move a KEP to `implementable`, or significant changes once
56-
it is marked `implementable`, must be approved by each of the KEP approvers.
57-
If none of those approvers are still appropriate, then changes to that list
58-
should be approved by the remaining approvers and/or the owning SIG (or
59-
SIG Architecture for cross-cutting KEPs).
60-
-->
611
# KEP-4818: Allow zero value for Sleep Action of PreStop Hook
622

63-
<!--
64-
A table of contents is helpful for quickly jumping to sections of a KEP and for
65-
highlighting any additional information provided beyond the standard KEP
66-
template.
67-
68-
Ensure the TOC is wrapped with
69-
<code>&lt;!-- toc --&rt;&lt;!-- /toc --&rt;</code>
70-
tags, and then generate with `hack/update-toc.sh`.
71-
-->
72-
733
<!-- toc -->
744
- [Release Signoff Checklist](#release-signoff-checklist)
755
- [Summary](#summary)
@@ -110,26 +40,12 @@ tags, and then generate with `hack/update-toc.sh`.
11040

11141
## Release Signoff Checklist
11242

113-
<!--
114-
**ACTION REQUIRED:** In order to merge code into a release, there must be an
115-
issue in [kubernetes/enhancements] referencing this KEP and targeting a release
116-
milestone **before the [Enhancement Freeze](https://git.k8s.io/sig-release/releases)
117-
of the targeted release**.
118-
119-
For enhancements that make changes to code or processes/procedures in core
120-
Kubernetes—i.e., [kubernetes/kubernetes], we require the following Release
121-
Signoff checklist to be completed.
122-
123-
Check these off as they are completed for the Release Team to track. These
124-
checklist items _must_ be updated for the enhancement to be released.
125-
-->
126-
12743
Items marked with (R) are required *prior to targeting to a milestone / release*.
12844

129-
- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
130-
- [ ] (R) KEP approvers have approved the KEP status as `implementable`
131-
- [ ] (R) Design details are appropriately documented
132-
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
45+
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
46+
- [x] (R) KEP approvers have approved the KEP status as `implementable`
47+
- [x] (R) Design details are appropriately documented
48+
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
13349
- [ ] e2e Tests for all Beta API Operations (endpoints)
13450
- [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
13551
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
@@ -231,13 +147,6 @@ As a Kubernetes user, I want to to be able to have a PreStop hook defined in my
231147

232148
### Notes/Constraints/Caveats (Optional)
233149

234-
<!--
235-
What are the caveats to the proposal?
236-
What are some important details that didn't come across above?
237-
Go in to as much detail as necessary here.
238-
This might be a good place to talk about core concepts and how they relate.
239-
-->
240-
241150
### Risks and Mitigations
242151

243152
The change is opt-in, since it requires configuring a PreStop hook with sleep action of 0 second duration. So there is no risk beyond the upgrade/downgrade risks which are addressed in the Proposal section.
@@ -248,17 +157,6 @@ Refer to the Proposal section.
248157

249158
### Test Plan
250159

251-
<!--
252-
**Note:** *Not required until targeted at a release.*
253-
The goal is to ensure that we don't accept enhancements with inadequate testing.
254-
255-
All code is expected to have adequate tests (eventually with coverage
256-
expectations). Please adhere to the [Kubernetes testing guidelines][testing-guidelines]
257-
when drafting this test plan.
258-
259-
[testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
260-
-->
261-
262160
[x] I/we understand the owners of the involved components may require updates to
263161
existing tests to make this code solid enough prior to committing the changes necessary
264162
to implement this enhancement.
@@ -272,32 +170,16 @@ implementing this enhancement to ensure the enhancements have also solid foundat
272170

273171
##### Unit tests
274172

275-
<!--
276-
In principle every added code should have complete unit test coverage, so providing
277-
the exact set of tests will not bring additional value.
278-
However, if complete unit test coverage is not possible, explain the reason of it
279-
together with explanation why this is acceptable.
280-
-->
281-
282-
<!--
283-
Additionally, for Alpha try to enumerate the core package you will be touching
284-
to implement this enhancement and provide the current unit coverage for those
285-
in the form of:
286-
- <package>: <date> - <current test coverage>
287-
The data can be easily read from:
288-
https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit
289-
290-
This can inform certain test coverage improvements that we want to do before
291-
extending the production code to implement this enhancement.
292-
-->
293-
294173
Alpha:
295174

296175
- Test that the runSleepHandler function returns immediately when given a duration of zero.
297176
- Test that the validation succeeds when given a zero duration with the feature gate enabled.
298177
- Test that the validation fails when given a zero duration with the feature gate disabled.
299178
- Test that the validation returns the appropriate error messages when given an invalid duration value (e.g., a negative value) with the feature gate disabled and enabled.
300179
- Unit tests for testing the disabling of the feature gate after it was enabled and the feature was used.
180+
- Unit tests for pod with zero grace period duration and zero sleep duration with zero value enabled.
181+
- Unit test for pod with nil grace period with zero value disabled
182+
- Unit test for pod with nil grace period with zero value enabled
301183

302184
Current coverages:
303185

@@ -342,6 +224,12 @@ Basic functionality
342224
- Delete the pod and observe the time it takes for the container to terminate.
343225
- Verify that the container terminates immediately without sleeping.
344226

227+
Additional e2e tests for beta:
228+
- Test that pods with sleep value of 0 in PreStop hook can be created
229+
- Test that pods with sleep value of 0 in PostStart hook can be created
230+
- Test that pods with sleep value of 0 in PreStop hook can be updated
231+
- Test that pods with sleep value of 0 in PostStart hook can be updated
232+
345233
### Graduation Criteria
346234

347235
#### Alpha
@@ -350,7 +238,7 @@ Basic functionality
350238

351239
#### Beta
352240
- Gather feedback from developers and surveys
353-
- Additional e2e tests are completed (if needed)
241+
- Additional e2e tests are completed
354242
- No trouble reports from alpha release
355243

356244
#### GA
@@ -565,6 +453,9 @@ Major milestones might include:
565453
- when the KEP was retired or superseded
566454
-->
567455

456+
- 2024-09-26: Alpha KEP PR opened for v1.32
457+
- 2025-02-06: KEP updated targeting to beta in v1.33
458+
568459
## Drawbacks
569460

570461
N/A

keps/sig-node/4818-allow-zero-value-for-sleep-action-of-prestop-hook/kep.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ creation-date: "2024-09-16"
99

1010
reviewers:
1111
- "@kannon92"
12+
- "@ffromani"
1213
approvers:
1314
- "@SergeyKanzhelev"
1415

1516
see-also:
1617
- "/keps/sig-node/3960-pod-lifecycle-sleep-action"
1718

18-
stage: alpha
19+
stage: beta
1920

20-
latest-milestone: "v1.32"
21+
latest-milestone: "v1.33"
2122

2223
milestone:
2324
alpha: "v1.32"
24-
beta: ""
25+
beta: "v1.33"
2526
stable: ""
2627

2728
feature-gates:

0 commit comments

Comments
 (0)