<p>I tried creating a <strong>Replication Controller</strong> via an JSON file and I have mentioned <strong>restartPolicy</strong> as "Never" for <strong>pod restartPolicy</strong>.</p>

<p>but I am getting an error that,</p>

<p><strong>Error:
The ReplicationController "ngnix-rc" is invalid.
*spec.template.spec.restartPolicy: Unsupported value: "Never": supported values: Always</strong></p>

<p>Is there any change in v1.2 that it supports only "<strong>Always</strong>" as an option for <strong>restartPolicy</strong>? I'm confused.</p>

<p>I tried another scenario where I faced a strange behavior.
I specified the restart policy as "<strong>never</strong>" and I got the error as,</p>

<p><strong>Error:
The ReplicationController "ngnix-rc" is invalid.
*spec.template.spec.restartPolicy: Unsupported value: "never": supported values: Always, OnFailure, Never
*spec.template.spec.restartPolicy: Unsupported value: "never": supported values: Always</strong></p>

<p>As found, there are two errors in this scenario.
I don't know what is the exact problem.</p>

<p>The JSON file that i used to create RC is given below</p>

<pre><code>{
  "kind":"ReplicationController",
  "apiVersion":"v1",
  "metadata":{
    "name":"ngnix-rc",
    "labels":{
      "app":"webserver"
    }
  },
  "spec":{
    "replicas":1,
    "selector":{
      "app":"webserver1"
    },
    "template":{
      "metadata":{
        "name":"ngnix-pod",
        "labels":{
          "app":"webserver1"
        }
      },
      "spec":{
        "containers":[
          {
            "image":"ngnix",
            "name":"nginx"
          }
        ],
        "restartPolicy":"Never"
      } 
    }
  }
}
</code></pre>

<p>To expand on zhb's answer: while different restart policies make sense for single pods, or even for run-to-completion jobs, a replication controller's entire purpose is to keep N instances of a pod running, so saying that you don't want the pods restarted doesn't mesh great with the concept.</p>

<p>The part of the docs that explains this is: <a href="http://kubernetes.io/docs/user-guide/pod-states/#restartpolicy" rel="nofollow">http://kubernetes.io/docs/user-guide/pod-states/#restartpolicy</a></p>
