<p>When my pod hits a failure state I'd like to have it deleted (and recreated by the deployment) rather than restarted. Is there a setting I could enable for that?</p>

chris.mclennon
<p>As mentioned by <a href="https://stackoverflow.com/users/11332370/alassane-ndiaye"> Alassane Ndiaye</a>.
Please take a look for <a href="https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#voluntary-and-involuntary-disruptions" rel="nofollow noreferrer">"Voluntary and Involuntary Disruptions"</a> and <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-lifetime" rel="nofollow noreferrer">"Pod lifetime"</a></p>

<blockquote>
  <p>In general, Pods do not disappear until someone destroys them. This might be a human or a controller. The only exception to this rule is that Pods with a phase of Succeeded or Failed for more than some duration (determined by terminated-pod-gc-threshold in the master) will expire and be automatically destroyed.</p>
  
  <p>All three types of controllers (<strong>Job, Replicaset, DaemonSet</strong>) contain a PodTemplate. It is recommended to create the appropriate controller and let it create Pods, rather than directly create Pods yourself. That is because Pods alone are not resilient to machine failures, but controllers are.</p>
</blockquote>

<p>On the other hand if you are interested with more sophisticated control you should consider using <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#using-statefulsets" rel="nofollow noreferrer">Statefulset</a> instead:</p>

<blockquote>
  <p>StatefulSets are valuable for applications that require one or more of the following:</p>
  
  <ul>
  <li>Stable, unique network identifiers.</li>
  <li>Stable, persistent storage</li>
  <li><strong>Ordered, graceful deployment and scaling</strong>.</li>
  <li>Ordered, automated rolling updates.</li>
  </ul>
</blockquote>
