<p>I was trying to use the quota feature in kubernetes but everytime my container is stuck on &quot;ContainerCreating&quot; and not moving forward.</p>
<p>I'm not sure what could be the issue .</p>
<p>MyQuota yaml:</p>
<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
  creationTimestamp: null
  name: awesome-quota
spec: 
  hard:
     pods: 2
     requests.cpu: 1
     requests.memory: 1024m
     limits.cpu: 4
     limits.memory: 4096m

status: {}
</code></pre>
<p>My nginx yaml having quota details:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: nginx
  name: nginx
spec:
  containers:
  - image: nginx:1.18.0
    name: nginx
    resources:
      limits:
        cpu: &quot;1&quot;
        memory: &quot;1024m&quot;
      requests:
        cpu: &quot;0.5&quot;
        memory: &quot;512m&quot;
  dnsPolicy: ClusterFirst
  restartPolicy: Never
status: {}
</code></pre>
<p>Thanks
Abdul</p>

Abdul Mohsin
<p>Change the memory unit to &quot;Mi&quot;. Note your sample was modified slightly to limit the scope in kube-public namespace.</p>
<pre><code>&gt; cat &lt;&lt; EOF | kubectl apply -f -
&gt; apiVersion: v1
&gt; kind: ResourceQuota
&gt; metadata:
&gt;   name: test-quota
&gt;   namespace: kube-public
&gt; spec: 
&gt;   hard:
&gt;      pods: 2
&gt;      requests.cpu: 1
&gt;      requests.memory: 1024Mi
&gt;      limits.cpu: 4
&gt;      limits.memory: 4096Mi
&gt; EOF
resourcequota/test-quota created
</code></pre>
<p>Run your sample pod:</p>
<pre><code>&gt; cat &lt;&lt; EOF | kubectl apply -f -
&gt; apiVersion: v1
&gt; kind: Pod
&gt; metadata:
&gt;   labels:
&gt;     app: nginx
&gt;   name: nginx
&gt;   namespace: kube-public
&gt; spec:
&gt;   containers:
&gt;   - image: nginx:latest
&gt;     name: nginx
&gt;     resources:
&gt;       limits:
&gt;         cpu: &quot;1&quot;
&gt;         memory: &quot;1024Mi&quot;
&gt;       requests:
&gt;         cpu: &quot;0.5&quot;
&gt;         memory: &quot;512Mi&quot;
&gt;   dnsPolicy: ClusterFirst
&gt;   restartPolicy: Never
&gt; EOF
pod/nginx created
</code></pre>
<p>The pod runs as expected:</p>
<pre><code>&gt; kubectl get pods -n kube-public
NAME    READY   STATUS    RESTARTS   AGE
nginx   1/1     Running   0          37s
</code></pre>
<p>If resources.limits has no upper bound:</p>
<pre><code>&gt; cat &lt;&lt; EOF | kubectl apply -f -
&gt; apiVersion: v1
&gt; kind: Pod
&gt; metadata:
&gt;   labels:
&gt;     app: nginx
&gt;   name: nginx
&gt;   namespace: kube-public
&gt; spec:
&gt;   containers:
&gt;   - image: nginx:latest
&gt;     name: nginx
&gt;     resources:
&gt;       requests:
&gt;         cpu: &quot;0.5&quot;
&gt;         memory: &quot;512Mi&quot;
&gt;   dnsPolicy: ClusterFirst
&gt;   restartPolicy: Never
&gt; EOF
Error from server (Forbidden): error when creating &quot;STDIN&quot;: pods &quot;nginx&quot; is forbidden: failed quota: test-quota: must specify limits.cpu,limits.memory
</code></pre>
