I have a deployment template which has below resources settings:
Limits:
cpu: 2
memory: 8Gi
Requests:
cpu: 500m
memory: 2Gi
I believe the Kubernetes will allocate my pod with CPU between 500m ~ 2 core, and memory between 2Gi ~ 8Gi.
However, when I ssh into the pod, when I run below command to get the CPU/Memory, seems the resource allocation is not correct:
[root@xxx /]# cat /proc/meminfo
MemTotal: 15950120 kB
MemFree: 6629072 kB
MemAvailable: 12728888 kB
15950120 kB is around 15.9 Gi.
grep 'cpu cores' /proc/cpuinfo | uniq
cpu cores : 2
The CPU on the pod is 2 core.
So my question is why I set the limit for the memory is 8Gi, but I got 16Gi in total?
Also for the CPU, I just request 500m core but why it shows 2cores?