Kubernetes v1.34: Finer-Grained Control Over Container Restarts
With the release of Kubernetes 1.34, a new alpha feature is introduced that gives you more granular control over container restarts within a Pod. This feature, named Container Restart Policy and Rules , allows you to specify a restart policy for each container individually, overriding the Pod's global restart policy. In addition, it also allows you to conditionally restart individual containers based on their exit codes. This feature is available behind the alpha feature gate ContainerRestartRules . This has been a long-requested feature. Let's dive into how it works and how you can use it. The problem with a single restart policy Before this feature, the restartPolicy was set at the Pod level. This meant that all containers in a Pod shared the same restart policy ( Always , OnFailure , or Never ). While this works for many use cases, it can be limiting in others. For example, consider a Pod with a main application container and an init container that performs some initial setup. You m
Continue reading on Kubernetes Blog
Opens in a new tab



