简体   繁体   English

Kubernetes如何执行容器的内存限制?

[英]How does Kubernetes enforce the memory limit for a container?

How does it enforce the limit? 它如何执行限制? Is it via cgroups? 是通过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). 我似乎有一个获取SIGKILL的容器进程,但是pod没有重新启动(但是该进程死于SIGKILL)。 So I'm unsure what the cause of it is. 所以我不确定是什么原因造成的。

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

IIUC, the process which consumes the most memory will be oom-killed in this case. 在这种情况下,将消耗大量内存的IIUC进程被杀死。 The container won't terminate unless the killed perocess is the main process within the container. 除非杀死的气味是容器内的主要过程,否则容器不会终止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM