<p>I wonder if it is possible to use container restart policy <code>&quot;always&quot;</code> or <code>&quot;onFailure&quot;</code> only if the pod has min. one clean start?</p>
<p>Something like this:</p>
<pre><code>first start -&gt; failed -&gt; never start again

first start -&gt; ok -&gt; &quot;some error&quot; while running -&gt; restart
</code></pre>
<p>thanks and best regards.</p>

zie-pao
<p>This is not possible with Kubernetes/OpenShift built-in controllers. If you need custom behavior you could create a custom resource and a corresponding controller (operator). For more information consider <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/" rel="nofollow noreferrer">Custom Resources
</a> and <a href="https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/" rel="nofollow noreferrer">&quot;Extend the Kubernetes API with CustomResourceDefinitions&quot;</a> in the Kubernetes docs.</p>
