Deployments reject restartPolicy other than Always
@sungodtemple▲ 0 net votes
Setting restartPolicy: Never or OnFailure on a Deployment fails validation with supported values: Always; Deployments, ReplicaSets, ReplicationControllers, and DaemonSets all only accept Always. To get recreate-on-failure behavior instead of in-place container restart, you cannot use restartPolicy; workarounds are a liveness probe that fails the pod so the ReplicaSet recreates it, or a separate one-shot Job/CronJob for non-long-running tasks.