diff --git a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md index ae96bb7551..868d8d56e8 100644 --- a/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md +++ b/content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md @@ -199,7 +199,7 @@ service PodResourcesLister { The `List` endpoint provides information on resources of running pods, with details such as the id of exclusively allocated CPUs, device id as it was reported by device plugins and id of -the NUMA node where these devices are allocated. +the NUMA node where these devices are allocated. Also, for NUMA-based machines, it contains the information about memory and hugepages reserved for a container. ```gRPC // ListPodResourcesResponse is the response returned by List function @@ -219,6 +219,14 @@ message ContainerResources { string name = 1; repeated ContainerDevices devices = 2; repeated int64 cpu_ids = 3; + repeated ContainerMemory memory = 4; +} + +// ContainerMemory contains information about memory and hugepages assigned to a container +message ContainerMemory { + string memory_type = 1; + uint64 size = 2; + TopologyInfo topology = 3; } // Topology describes hardware topology of the resource @@ -247,6 +255,7 @@ It provides more information than kubelet exports to APIServer. message AllocatableResourcesResponse { repeated ContainerDevices devices = 1; repeated int64 cpu_ids = 2; + repeated ContainerMemory memory = 3; } ``` diff --git a/content/en/docs/tasks/administer-cluster/memory-manager.md b/content/en/docs/tasks/administer-cluster/memory-manager.md index 1cf3f07dd5..27a0ed2405 100644 --- a/content/en/docs/tasks/administer-cluster/memory-manager.md +++ b/content/en/docs/tasks/administer-cluster/memory-manager.md @@ -1,5 +1,5 @@ --- -title: Memory Manager +title: Utilizing the NUMA-aware Memory Manager reviewers: - klueska @@ -11,7 +11,7 @@ min-kubernetes-server-version: v1.21 -{{< feature-state state="alpha" for_k8s_version="v1.21" >}} +{{< feature-state state="beta" for_k8s_version="v1.22" >}} The Kubernetes *Memory Manager* enables the feature of guaranteed memory (and hugepages) allocation for pods in the `Guaranteed` {{< glossary_tooltip text="QoS class" term_id="qos-class" >}}. @@ -29,12 +29,14 @@ To align memory resources with other requested resources in a Pod Spec: - the CPU Manager should be enabled and proper CPU Manager policy should be configured on a Node. See [control CPU Management Policies](/docs/tasks/administer-cluster/cpu-management-policies/); - the Topology Manager should be enabled and proper Topology Manager policy should be configured on a Node. See [control Topology Management Policies](/docs/tasks/administer-cluster/topology-manager/). -Support for the Memory Manager requires `MemoryManager` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled. +Starting from v1.22, the Memory Manager is enabled by default through `MemoryManager` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/). -That is, the `kubelet` must be started with the following flag: +Preceding v1.22, the `kubelet` must be started with the following flag: `--feature-gates=MemoryManager=true` +in order to enable the Memory Manager feature. + ## How Memory Manager Operates? The Memory Manager currently offers the guaranteed memory (and hugepages) allocation for Pods in Guaranteed QoS class. To immediately put the Memory Manager into operation follow the guidelines in the section [Memory Manager configuration](#memory-manager-configuration), and subsequently, prepare and deploy a `Guaranteed` pod as illustrated in the section [Placing a Pod in the Guaranteed QoS class](#placing-a-pod-in-the-guaranteed-qos-class). @@ -211,6 +213,10 @@ The following means can be used to troubleshoot the reason why a pod could not b - pod status - indicates topology affinity errors - system logs - include valuable information for debugging, e.g., about generated hints - state file - the dump of internal state of the Memory Manager (includes [Node Map and Memory Maps][2]) +- starting from v1.22, the [device plugin resource API](#device-plugin-resource-api) can be used + to retrieve information about the memory reserved for containers + + ### Pod status (TopologyAffinityError) {#TopologyAffinityError} @@ -358,6 +364,10 @@ For example, the total amount of free "conventional" memory in the group can be The line `"systemReserved":3221225472` indicates that the administrator of this node reserved `3221225472` bytes (i.e. `3Gi`) to serve kubelet and system processes at NUMA node `0`, by using `--reserved-memory` flag. +### Device plugin resource API + +By employing the [API](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/), the information about reserved memory for each container can be retrieved, which is contained in protobuf `ContainerMemory` message. This information can be retrieved solely for pods in Guaranteed QoS class. + ## {{% heading "whatsnext" %}} - [Memory Manager KEP: Design Overview][4]