I wonder if there is a way to have a deployment stop recreating new pods, when those failed multiple times. In other, given that we can't for instance have a restartPolicy never in a pod template of a Deployment, i am wondering, how can i consider a service failed and have in a stopped state.
We have a use case, where imperatively need to have kubernetes interrupt a deployment that have all his pods constantly failing.
Consider using a type "Job" instead of Deployment. According to the docs:
Use a Job for Pods that are expected to terminate, for example, batch computations. Jobs are appropriate only for Pods with restartPolicy equal to OnFailure or Never.
Hope this helps!