--oom-score-adj=-999
of kubelet
command seems not work. From now on, I find only the docker run --oom-kill-disable
works fine to avoid containers killed by oom.
so is there a way to mimic this option in kubernetes? via environment variables?
See https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/resource-qos.md (despite being in the "proposals" directory, what is described there is implemented)
The short answer is that it's not possible to force --oom-score-adj=-999 on your container, but setting "limit" and "request" equal ensures the system will try very hard to not kill your container when there is OOM (critical Kubernetes processes like kubelet will have better oom score, but no user containers will have better OOM score).