How does Kubernetes enforce the memory limit for a container?

4/27/2018

How does it enforce the limit? Is it via cgroups? Or is there an actual process watching container processes and terminating them?

I seem to have a container process that gets a SIGKILL, but the pod does not get restarted (but the process dies because SIGKILL). So I'm unsure what the cause of it is.

-- Chris Stryczynski
kubernetes

1 Answer

4/27/2018

https://github.com/kubernetes/kubernetes/issues/50632

IIUC, the process which consumes the most memory will be oom-killed in this case. The container won't terminate unless the killed perocess is the main process within the container.

-- Chris Stryczynski
Source: StackOverflow