锦瑟无端五十弦,一弦一柱思华年
备注:由于外文不便于阅读,该文引用官方文档解读资源限额,作为学习资源供需要的人参考。
如有不对的地方可以指出,交流进步。
Reserve Compute Resources for System Daemons | Kubernetes
'Allocatable' on a Kubernetes node is defined as the amount of compute resources that are available for pods. The scheduler does not over-subscribe 'Allocatable'. 'CPU', 'memory' and 'ephemeral-storage' are supported as of now.
Node Allocatable is exposed as part of
v1.Node
object in the API and as part ofkubectl describe node
in the CLI.Resources can be reserved for two categories of system daemons in the
kubelet
.
1 Enabling QoS and Pod level cgroups (启动QoS和Pod级别cgroups管理功能)
To properly enforce node allocatable constraints on the node, you must enable the new cgroup hierarchy via the
--cgroups-per-qos
flag. This flag is enabled by default. When enabled, thekubelet
will parent all end-user pods under a cgroup hierarchy managed by thekubelet
.
大致意思:使用节点限资源预留功能的前提是开启cgroups-per-qos 功能,使用--cgroups-per-qos开启并且默认是开启的。
确保cgroups-per-qos 是开启的后,pod资源将处于cgroup资源管理体系下,然后kubelet通过cgroups来管理所有终端用户pod的资源分配。
这里需要了解cgroup这个系统组件的作用,根据百度百科所说:
cgroups,其名称源自控制组群(control groups)的简写,是Linux内核的一个功能,用来限制、控制与分离一个进程组的资源(如CPU、