<p>I am trying to limit the number of pod restarts by using the <code>backoffLimit</code> parameter, but I am getting this below error:</p>
<pre><code>error: error validating &quot;STDIN&quot;: error validating data: ValidationError(Deployment.spec): unknown field &quot;backoffLimit&quot; in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>
<p>Below is my <code>deployment.yaml</code> file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include &quot;out-service.fullname&quot; . }}
  namespace: {{ .Values.namespace }}

spec:
  backoffLimit: 2
  replicas: {{ .Values.replicaCount }}
  strategy:
    type: RollingUpdate
  selector:
    matchLabels:
</code></pre>
<p>Please let me know, if I am missing something.</p>
<p>Thanks!</p>

Pritish
<p><code>backoffLimit</code> is not a Kubernetes deployment object parameter. That's the reason for this error. Unfortunately, you cannot limit the pod restart count. However, you can control this behaviour using <code>restartPolicy</code> parameter for the pod spec.</p>
<p>Just to let you know, You can specify <code>backoffLimit</code> with Kubernetes Jobs which creates Pods and will continue to retry execution of the Pods until a specified number(backoffLimit) of them successfully terminates.</p>
