Add docs for KubeletCrashLoopBackOffMax feature

Signed-off-by: Laura Lorenz <lauralorenz@google.com>
pull/48499/head
Laura Lorenz 2024-10-22 10:35:14 -07:00
parent 7e26a80e3d
commit 14c968c3e2
2 changed files with 46 additions and 0 deletions

View File

@ -260,6 +260,38 @@ problems, the kubelet resets the restart backoff timer for that container.
[Sidecar containers and Pod lifecycle](/docs/concepts/workloads/pods/sidecar-containers/#sidecar-containers-and-pod-lifecycle)
explains the behaviour of `init containers` when specify `restartpolicy` field on it.
### Configurable container restart delay
{{< feature-state for_k8s_version="v1.32" state="alpha" >}}
With the alpha feature gate `KubeletCrashLoopBackOffMax` enabled, you can
reconfigure the maximum delay between container restarts from the default of
300s (5 minutes). This configuration is set per node using kubelet
configuration. In your [kubelet
configuration](https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/),
set the `CrashLoopBackOff.MaxContainerRestartPeriod` field between `"1s"` and
`"300s"`. Delays on that node will still start at 10s and increase exponentially
by 2x each restart, until being capped at your configured maximum. If the
`CrashLoopBackOff.MaxContainerRestartPeriod` you configure is less than the
default initial value of 10s, the initial delay will instead be set to the
configured maximum.
See the following kubelet configuration examples:
```yaml
# container restart delays will start at 10s, increasing
# 2x each time they are restarted, to a maximum of 100s
kind: KubeletConfiguration
crashLoopBackOff:
maxContainerRestartPeriod: "100s"
```
```yaml
# delays between container restarts will always be 2s
kind: KubeletConfiguration
crashLoopBackOff:
maxContainerRestartPeriod: "2s"
```
## Pod conditions

View File

@ -0,0 +1,14 @@
---
title: KubeletCrashLoopBackOffMax
content_type: feature_gate
_build:
list: never
render: false
stages:
- stage: alpha
defaultValue: false
fromVersion: "1.32"
---
Enables support for configurable per-node backoff maximums for restarting
containers (aka containers in CrashLoopBackOff)