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
Copy file name to clipboardexpand all lines: content/zh-cn/docs/concepts/workloads/pods/pod-lifecycle.md
+111-5
Original file line number
Diff line number
Diff line change
@@ -288,6 +288,103 @@ the `Terminated` state.
288
288
如果容器配置了 `preStop` 回调,则该回调会在容器进入 `Terminated`
289
289
状态之前执行。
290
290
291
+
<!--
292
+
## How Pods handle problems with containers {#container-restarts}
293
+
294
+
Kubernetes manages container failures within Pods using a [`restartPolicy`](#restart-policy) defined in the Pod `spec`. This policy determines how Kubernetes reacts to containers exiting due to errors or other reasons, which falls in the following sequence:
295
+
-->
296
+
297
+
## Pod 如何处理容器问题 {#container-restarts}
298
+
299
+
Kubernetes 通过在 Pod `spec` 中定义的 [`restartPolicy`](#restart-policy) 管理 Pod 内容器出现的失效。
300
+
该策略决定了 Kubernetes 如何对由于错误或其他原因而退出的容器做出反应,其顺序如下:
301
+
302
+
<!--
303
+
1. **Initial crash**: Kubernetes attempts an immediate restart based on the Pod `restartPolicy`.
304
+
1. **Repeated crashes**: After the initial crash Kubernetes applies an exponential
305
+
backoff delay for subsequent restarts, described in [`restartPolicy`](#restart-policy).
306
+
This prevents rapid, repeated restart attempts from overloading the system.
307
+
1. **CrashLoopBackOff state**: This indicates that the backoff delay mechanism is currently
308
+
in effect for a given container that is in a crash loop, failing and restarting repeatedly.
309
+
1. **Backoff reset**: If a container runs successfully for a certain duration
310
+
(e.g., 10 minutes), Kubernetes resets the backoff delay, treating any new crash
311
+
as the first one.
312
+
-->
313
+
314
+
1.**最初的崩溃**:Kubernetes 尝试根据 Pod 的 `restartPolicy` 立即重新启动。
0 commit comments