See What really happens when a Kubernetes container runs out of memory?, a semi-clickbait article about learning how the OOM killer, cgroups, and all that other messy stuff which underpins Kubernetes works.