Middle
What mechanism in Kubernetes restarts a container when it exceeds the memory limit?
sobes.tech AI
Answer from AI
In Kubernetes, when a container exceeds its memory limit, the OOM Killer (Out Of Memory Killer) mechanism at the operating system kernel level is triggered. When the container consumes more memory than specified in the limit, the kernel kills a process inside the container, leading to the container's termination. Kubernetes, in turn, detects that the container has exited with an error and restarts it according to the restart policy. Therefore, the container restart is not performed by Kubernetes itself, but as a reaction to the OOM Killer event.