diff --git a/content/en/docs/concepts/containers/container-lifecycle-hooks.md b/content/en/docs/concepts/containers/container-lifecycle-hooks.md index 1f3dd65bd0..a5274f5476 100644 --- a/content/en/docs/concepts/containers/container-lifecycle-hooks.md +++ b/content/en/docs/concepts/containers/container-lifecycle-hooks.md @@ -56,17 +56,20 @@ There are three types of hook handlers that can be implemented for Containers: Resources consumed by the command are counted against the Container. * HTTP - Executes an HTTP request against a specific endpoint on the Container. * Sleep - Pauses the container for a specified duration. - This is a beta-level feature default enabled by the `PodLifecycleSleepAction` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/). + This is a beta-level feature default enabled by the `PodLifecycleSleepAction` + [feature gate](/docs/reference/command-line-tools-reference/feature-gates/). {{< note >}} -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. +The beta level `PodLifecycleSleepActionAllowZero` feature gate which is enabled by default from v1.33. +It allows you to set a sleep duration of zero seconds (effectively a no-op) for your Sleep lifecycle hooks. {{< /note >}} ### Hook handler execution When a Container lifecycle management hook is called, the Kubernetes management system executes the handler according to the hook action, -`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. +`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. The `PostStart` hook handler call is initiated when a container is created, 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. If a handler fails for some reason, it broadcasts an event. For `PostStart`, this is the `FailedPostStartHook` event, and for `PreStop`, this is the `FailedPreStopHook` event. -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. +To generate a failed `FailedPostStartHook` event yourself, modify the +[lifecycle-events.yaml](https://k8s.io/examples/pods/lifecycle-events.yaml) +file to change the postStart command to "badcommand" and apply it. Here is some example output of the resulting events you see from running `kubectl describe pod lifecycle-demo`: ``` diff --git a/content/en/docs/reference/command-line-tools-reference/feature-gates/PodLifecycleSleepActionAllowZero.md b/content/en/docs/reference/command-line-tools-reference/feature-gates/PodLifecycleSleepActionAllowZero.md index 831f9555c1..9f9e95e32c 100644 --- a/content/en/docs/reference/command-line-tools-reference/feature-gates/PodLifecycleSleepActionAllowZero.md +++ b/content/en/docs/reference/command-line-tools-reference/feature-gates/PodLifecycleSleepActionAllowZero.md @@ -9,5 +9,9 @@ stages: - stage: alpha defaultValue: false fromVersion: "1.32" + toVersion: "1.32" + - stage: beta + defaultValue: true + fromVersion: "1.33" --- Enables setting zero value for the `sleep` action in [container lifecycle hooks](/docs/concepts/containers/container-lifecycle-hooks/).