@@ -86,34 +86,40 @@ A more detailed description of the termination behavior can be found in
86
86
### Hook handler implementations
87
87
88
88
Containers can access a hook by implementing and registering a handler for that hook.
89
- There are two types of hook handlers that can be implemented for Containers:
89
+ There are three types of hook handlers that can be implemented for Containers:
90
90
-->
91
91
### 回调处理程序的实现
92
92
93
93
容器可以通过实现和注册该回调的处理程序来访问该回调。
94
- 针对容器,有两种类型的回调处理程序可供实现 :
94
+ 针对容器,有三种类型的回调处理程序可供实现 :
95
95
96
96
<!--
97
97
* Exec - Executes a specific command, such as `pre-stop.sh`, inside the cgroups and namespaces of the Container.
98
98
Resources consumed by the command are counted against the Container.
99
99
* HTTP - Executes an HTTP request against a specific endpoint on the Container.
100
+ * Sleep - Pauses the container for a specified duration.
101
+ The "Sleep" action is available when the [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
102
+ `PodLifecycleSleepAction` is enabled.
100
103
-->
101
104
102
105
* Exec - 在容器的 cgroups 和名字空间中执行特定的命令(例如 ` pre-stop.sh ` )。
103
106
命令所消耗的资源计入容器的资源消耗。
104
107
* HTTP - 对容器上的特定端点执行 HTTP 请求。
108
+ * Sleep - 将容器暂停一段指定的时间。
109
+ 当[ 特性门控] ( /zh-cn/docs/reference/command-line-tools-reference/feature-gates/ ) ` PodLifecycleSleepAction ` 被启用时,
110
+ “Sleep” 操作才可用。
105
111
106
112
<!--
107
113
### Hook handler execution
108
114
109
115
When a Container lifecycle management hook is called,
110
116
the Kubernetes management system executes the handler according to the hook action,
111
- `httpGet` and `tcpSocket` are executed by the kubelet process, and `exec` is executed in the container.
117
+ `httpGet` , `tcpSocket` and `sleep ` are executed by the kubelet process, and `exec` is executed in the container.
112
118
-->
113
119
### 回调处理程序执行
114
120
115
121
当调用容器生命周期管理回调时,Kubernetes 管理系统根据回调动作执行其处理程序,
116
- ` httpGet ` 和 ` tcpSocket ` 在 kubelet 进程执行,而 ` exec ` 则由容器内执行 。
122
+ ` httpGet ` 、 ` tcpSocket ` 和 ` sleep ` 由 kubelet 进程执行,而 ` exec ` 在容器中执行 。
117
123
118
124
<!--
119
125
Hook handler calls are synchronous within the context of the Pod containing the Container.
0 commit comments