Skip to content

Commit 14c968c

Browse files
committed
Add docs for KubeletCrashLoopBackOffMax feature
Signed-off-by: Laura Lorenz <[email protected]>
1 parent 7e26a80 commit 14c968c

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

content/en/docs/concepts/workloads/pods/pod-lifecycle.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,38 @@ problems, the kubelet resets the restart backoff timer for that container.
260260
[Sidecar containers and Pod lifecycle](/docs/concepts/workloads/pods/sidecar-containers/#sidecar-containers-and-pod-lifecycle)
261261
explains the behaviour of `init containers` when specify `restartpolicy` field on it.
262262

263+
### Configurable container restart delay
264+
265+
{{< feature-state for_k8s_version="v1.32" state="alpha" >}}
266+
267+
With the alpha feature gate `KubeletCrashLoopBackOffMax` enabled, you can
268+
reconfigure the maximum delay between container restarts from the default of
269+
300s (5 minutes). This configuration is set per node using kubelet
270+
configuration. In your [kubelet
271+
configuration](https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/),
272+
set the `CrashLoopBackOff.MaxContainerRestartPeriod` field between `"1s"` and
273+
`"300s"`. Delays on that node will still start at 10s and increase exponentially
274+
by 2x each restart, until being capped at your configured maximum. If the
275+
`CrashLoopBackOff.MaxContainerRestartPeriod` you configure is less than the
276+
default initial value of 10s, the initial delay will instead be set to the
277+
configured maximum.
278+
279+
See the following kubelet configuration examples:
280+
281+
```yaml
282+
# container restart delays will start at 10s, increasing
283+
# 2x each time they are restarted, to a maximum of 100s
284+
kind: KubeletConfiguration
285+
crashLoopBackOff:
286+
maxContainerRestartPeriod: "100s"
287+
```
288+
289+
```yaml
290+
# delays between container restarts will always be 2s
291+
kind: KubeletConfiguration
292+
crashLoopBackOff:
293+
maxContainerRestartPeriod: "2s"
294+
```
263295
264296
## Pod conditions
265297
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: KubeletCrashLoopBackOffMax
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.32"
12+
---
13+
Enables support for configurable per-node backoff maximums for restarting
14+
containers (aka containers in CrashLoopBackOff)

0 commit comments

Comments
 (0)