<p>I'm using an AKS cluster running with K8s v1.16.15.</p>
<p>I'm following this simple example to assign some cpu to a pod and it does not work.
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/</a></p>
<p>After applying this yaml file for the request,</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: cpu-demo
  namespace: cpu-example
spec:
  containers:
  - name: cpu-demo-ctr
    image: vish/stress
    resources:
      limits:
        cpu: &quot;1&quot;
      requests:
        cpu: &quot;0.5&quot;
    args:
    - -cpus
- &quot;2&quot;
</code></pre>
<p>If I try Kubectl describe pod... I get the following:</p>
<pre><code>Events:
Type     Reason            Age        From               Message
----     ------            ----       ----               -------
Warning  FailedScheduling  &lt;unknown&gt;   default-scheduler  0/1 nodes are available: 1 Insufficient cpu.
</code></pre>
<p>But CPUs seems available, if I run kubectl top nodes, I get:</p>
<pre><code>CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%

702m         36%    4587Mi          100%
</code></pre>
<p>Maybe it is related to some AKS configuration but I can figure it out.</p>
<p>Do you have an idea of what is happening?</p>
<p>Thanks a lot in advance!!</p>

<p>Kubernetes will decide where the pod can schedule on using node allocatable resources, not real resource usages. You can see your node allocatable resource using <code>kubectl describe node &lt;your node name&gt;</code>. Refer <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#capacity" rel="nofollow noreferrer">Capacity and Allocatable</a> for more details. As I see the events logs, <code>0/1 nodes are available: 1 Insufficient cpu.</code>, you have just one worker node and the node has not cpu resource enough to run your pod with <code>requests.cpu: &quot;0.5&quot;</code>. Pod scheduling is based on requests resource size, not limits one.</p>
