When the memory limit in k8s container spec is less than 4MB, the pod will can not be created and will be always in ContainerCreating.
You will easily meet this problem when use m as the memory unit, because m is just 1/1000 byte, which is too small. So m can be used for memory, but it is not recommended.
Analysis
You can refer to Docker Doc, or verify by the command:
# docker run -m 128 nginx:latest
/usr/bin/docker-current: Error response from daemon: Minimum memory limit allowed is 4MB.
I think this limitation is not set by Docker, but the requirement of Linux kernel.
When the memory limit is less than 4MB, the created container will be immediately stopped by oom-killer.
Phenomenon
When the memory limit in k8s container spec is less than
4MB
, the pod will can not be created and will be always inContainerCreating
. You will easily meet this problem when usem
as the memory unit, becausem
is just 1/1000 byte, which is too small. Som
can be used for memory, but it is not recommended.Analysis
You can refer to Docker Doc, or verify by the command:
I think this limitation is not set by Docker, but the requirement of Linux kernel. When the memory limit is less than
4MB
, the created container will be immediately stopped by oom-killer.