You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Docs PR for KEP 4818: Pod Lifecycle Sleep action allow zero value
* Update container-lifecycle-hooks.md
---------
Co-authored-by: Qiming Teng <[email protected]>
Copy file name to clipboardExpand all lines: content/en/docs/concepts/containers/container-lifecycle-hooks.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,17 +56,20 @@ There are three types of hook handlers that can be implemented for Containers:
56
56
Resources consumed by the command are counted against the Container.
57
57
* HTTP - Executes an HTTP request against a specific endpoint on the Container.
58
58
* 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`
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.
63
65
{{< /note >}}
64
66
65
67
### Hook handler execution
66
68
67
69
When a Container lifecycle management hook is called,
68
70
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.
and `sleep` are executed by the kubelet process, and `exec` is executed in the container.
70
73
71
74
The `PostStart` hook handler call is initiated when a container is created,
72
75
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.
110
113
If a handler fails for some reason, it broadcasts an event.
111
114
For `PostStart`, this is the `FailedPostStartHook` event,
112
115
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
0 commit comments