Support for pod memory requests/limits was introduced in #971. Through launch.container.memory.resource.policy system preference it is possible to configure pod requests/limits in three configurations:
Even though those configurations provide a way to hard limit pods memory consumption, they does not provide a required level of flexibility in terms of how to allow multiple services to run on the same node efficiently. Additionaly, such configuration does not include kubelet reserved memory which may lead to memory starvation in kubelet, system and pod altogether.
Approach
Existing mechanism can be replaced by a more efficient and flexible approach which allows to specify platform level requirements for kubelet daemon and system processes via the system preferences.
The following configuration shall be supported in launch.container.memory.resource.policy system preference:
The following system preferences shall be introduced:
Kube memory preferences configure an amount of node memory which is reserved for kubernetes system daemons
cluster.node.kube.mem.ratio = 2.5 %
cluster.node.kube.mem.min.mib = 256 MiB
cluster.node.kube.mem.max.mib = 1024 MiB
System memory preferences configure an amount of node memory which is reserved for OS system daemons
cluster.node.system.mem.ratio = 2.5 %
cluster.node.system.mem.min.mib = 256 MiB
cluster.node.system.mem.max.mib = 1024 MiB
Extra memory preferences configure an amount of node memory which is reserved for extra components (e.g. daemon sets) and unallocatable memory
cluster.node.extra.mem.ratio = 5 %
cluster.node.extra.mem.min.mib = 512 MiB
cluster.node.extra.mem.max.mib = 2147483647 MiB
Considerations behind extra mem ratio
A small research has been took that revealed a baseline for an amount of unallocatable memory on AWS EC2. It has been shown that for most instance types 95% of nominal memory is actually available for use. See more in #3397.
Background
Support for pod memory requests/limits was introduced in #971. Through launch.container.memory.resource.policy system preference it is possible to configure pod requests/limits in three configurations:
Even though those configurations provide a way to hard limit pods memory consumption, they does not provide a required level of flexibility in terms of how to allow multiple services to run on the same node efficiently. Additionaly, such configuration does not include kubelet reserved memory which may lead to memory starvation in kubelet, system and pod altogether.
Approach
Existing mechanism can be replaced by a more efficient and flexible approach which allows to specify platform level requirements for kubelet daemon and system processes via the system preferences.
The following configuration shall be supported in launch.container.memory.resource.policy system preference:
The following system preferences shall be introduced:
Considerations behind extra mem ratio
A small research has been took that revealed a baseline for an amount of unallocatable memory on AWS EC2. It has been shown that for most instance types 95% of nominal memory is actually available for use. See more in #3397.