Kubernetes Blog
Follow
Kubernetes 1.31: Pod Failure Policy for Jobs Goes GA
Kubernetes Pod failure policy, now stable in version 1.31, allows you to control Pod failure behavior in Jobs. It extends the backoffLimit mechanism to minimize costs and improve reliability.You can specify rules to ignore retriable failures, fail Jobs on non-retriable failures, or count failures towards backoff limits.Match rules are based on container exit codes or Pod conditions, including a new DisruptionTarget condition for Kubernetes-initiated disruptions.Pod failure policy should be used with restartPolicy: Never to prevent race conditions.The policy allows you to ignore failures caused by node shutdown or preemption to save costs when using spot machines.An example policy ignores disruption-related failures, fails Jobs on ConfigIssue failures, and counts exit code 42 failures.Additional work is underway, including integration with JobSets and more granular failure reasons.The feature was developed in collaboration with SIG Apps, SIG Node, and SIG Scheduling.It helps reduce operating costs and improve the reliability of long-running Jobs, especially in large-scale scenarios.