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.
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.