Skip to content

Commit cf40ef0

Browse files
KEP 4818: PodLifecycleSleepActionAllowZero beta graduation (#49858)
* Docs PR for KEP 4818: Pod Lifecycle Sleep action allow zero value * Update container-lifecycle-hooks.md --------- Co-authored-by: Qiming Teng <[email protected]>
1 parent afd8051 commit cf40ef0

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

content/en/docs/concepts/containers/container-lifecycle-hooks.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,20 @@ There are three types of hook handlers that can be implemented for Containers:
5656
Resources consumed by the command are counted against the Container.
5757
* HTTP - Executes an HTTP request against a specific endpoint on the Container.
5858
* Sleep - Pauses the container for a specified duration.
59-
This is a beta-level feature default enabled by the `PodLifecycleSleepAction` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
59+
This is a beta-level feature default enabled by the `PodLifecycleSleepAction`
60+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
6061

6162
{{< note >}}
62-
Enable the `PodLifecycleSleepActionAllowZero` feature gate if you want to set a sleep duration of zero seconds (effectively a no-op) for your Sleep lifecycle hooks.
63+
The beta level `PodLifecycleSleepActionAllowZero` feature gate which is enabled by default from v1.33.
64+
It allows you to set a sleep duration of zero seconds (effectively a no-op) for your Sleep lifecycle hooks.
6365
{{< /note >}}
6466

6567
### Hook handler execution
6668

6769
When a Container lifecycle management hook is called,
6870
the Kubernetes management system executes the handler according to the hook action,
69-
`httpGet`, `tcpSocket` ([deprecated](/docs/reference/generated/kubernetes-api/v1.31/#lifecyclehandler-v1-core)) and `sleep` are executed by the kubelet process, and `exec` is executed in the container.
71+
`httpGet`, `tcpSocket` ([deprecated](/docs/reference/generated/kubernetes-api/v1.31/#lifecyclehandler-v1-core))
72+
and `sleep` are executed by the kubelet process, and `exec` is executed in the container.
7073

7174
The `PostStart` hook handler call is initiated when a container is created,
7275
meaning the container ENTRYPOINT and the `PostStart` hook are triggered simultaneously.
@@ -110,7 +113,9 @@ The logs for a Hook handler are not exposed in Pod events.
110113
If a handler fails for some reason, it broadcasts an event.
111114
For `PostStart`, this is the `FailedPostStartHook` event,
112115
and for `PreStop`, this is the `FailedPreStopHook` event.
113-
To generate a failed `FailedPostStartHook` event yourself, modify the [lifecycle-events.yaml](https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/pods/lifecycle-events.yaml) file to change the postStart command to "badcommand" and apply it.
116+
To generate a failed `FailedPostStartHook` event yourself, modify the
117+
[lifecycle-events.yaml](https://k8s.io/examples/pods/lifecycle-events.yaml)
118+
file to change the postStart command to "badcommand" and apply it.
114119
Here is some example output of the resulting events you see from running `kubectl describe pod lifecycle-demo`:
115120

116121
```

content/en/docs/reference/command-line-tools-reference/feature-gates/PodLifecycleSleepActionAllowZero.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ stages:
99
- stage: alpha
1010
defaultValue: false
1111
fromVersion: "1.32"
12+
toVersion: "1.32"
13+
- stage: beta
14+
defaultValue: true
15+
fromVersion: "1.33"
1216
---
1317
Enables setting zero value for the `sleep` action in [container lifecycle hooks](/docs/concepts/containers/container-lifecycle-hooks/).

0 commit comments

Comments
 (0)