<p>Is there any way to stop restarting pod again and again when inside container fails.</p>

<p>simple way to check this is to pass <code>[ "exit", "1" ]</code> to pod as-    </p>

<pre><code>enter code here
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
spec:
  containers:
  - name: myapp-container
    image: alpine:latest
    command: ['sh','-c','exit','1']
</code></pre>

<p>Note -<br>
<code>RestartPolicy : Never</code>    this option is unsupported. </p>

Yogesh Jilhawar
<p>You will need to change the restart policy of the pod:</p>

<blockquote>
  <p>A PodSpec has a restartPolicy field with possible values Always, OnFailure, and Never. The default value is Always. restartPolicy applies to all Containers in the Pod. restartPolicy only refers to restarts of the Containers by the kubelet on the same node. Exited Containers that are restarted by the kubelet are restarted with an exponential back-off delay (10s, 20s, 40s …) capped at five minutes, and is reset after ten minutes of successful execution. As discussed in the Pods document, once bound to a node, a Pod will never be rebound to another node.</p>
</blockquote>

<p>See more details <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/questions/40530946/what-is-the-difference-between-always-and-on-failure-for-kubernetes-restart-poli">here</a>.</p>
