<p>I am facing an issue in kubernetes. I have a deployment and in replicaset we have given value as 2. After updating my release it is showing 3 replicas. 2 of them are running properly but one is in CrashLoopBackOff. I tried deleting it but it again comes up with same error.</p>
<p>There are 2 containers running in the po. In one container I am able to login but not able to login into nginx-cache container</p>
<pre class="lang-none prettyprint-override"><code>deployment-5bd9ff7f9d      1/2     CrashLoopBackOff   297 (2m19s ago)   24h  (this is the error)
deployment-ffbf89fcd       2/2     Running            0                 36d
deployment-ffbf89fcd       2/2     Running            0                 36d
</code></pre>
<p>Kubectl describe pod</p>
<pre><code>Warning  Failed     44m (x4 over 44m)      kubelet            Error: failed to create containerd task: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: failed to write &quot;107374182400000&quot;: write /sys/fs/cgroup/cpu,cpuacct/kubepods/burstable/podc22d1a88-befe-4680-8eec-2ad69a4cc890/nginx-cache/cpu.cfs_quota_us: invalid argument: unknown
Normal   Pulled     43m (x5 over 44m)      kubelet            Container image &quot;abcd2.azurecr.io/ab_cde/nginx-cache:0.2-ROOT&quot; already present on machine
</code></pre>
<p>How to remove that error</p>

<p>As seen from your <em>get pods</em>, the Deployment in <strong>CrashLoopBackOff</strong> state has a different hash from the other 2; it would appear that it is being handled by a different ReplicaSet than the other 2.</p>
<blockquote>
<p>The pod-template-hash label is added by the Deployment controller to every ReplicaSet that a Deployment creates or adopts.</p>
</blockquote>
<blockquote>
<p>This label ensures that child ReplicaSets of a Deployment do not overlap. It is generated by hashing the PodTemplate of the ReplicaSet and using the resulting hash as the label value that is added to the ReplicaSet selector, Pod template labels, and in any existing Pods that the ReplicaSet might have.</p>
</blockquote>
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template-hash-label" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#pod-template-hash-label</a></p>
<p>Try running <code>kubectl -n YOUR-NAMESPACE get replicasets</code>; if you find 2, delete the one that corresponds to the Pod with the error.</p>
