How to limit allocatable memory per node on Kubernetes?

10/18/2017

I would like to limit allocatable memory per node (VM) on Kubernetes.

Now it seems that certain pods can grow over the memory limit of VM making it unresponsive instead of killing pods before that happens.

-- Tadas Ĺ ubonis
azure
kubernetes
limit
quotas

1 Answer

10/18/2017

See Reserve Compute Resources for System Daemons.

In the systemd, we can configure kubelet with Node Allocatable feature like this.

$ cat > /etc/systemd/system/kubelet.service.d/20-node-eviction.conf <<EOF
Environment="KUBELET_EXTRA_ARGS=--eviction-hard=memory.available<500Mi --system-reserved=memory=1Gi"
EOF
$ systemctl daemon-reload
-- silverfox
Source: StackOverflow