Skip to content

Commit 11c8889

Browse files
cezaryzukowskiTim Bannistertengqm
authored
The Memory Manager graduates to Beta (#28851)
* Update gRPC messages documentation * Revisions + extend docs * Update content/en/docs/tasks/administer-cluster/memory-manager.md Co-authored-by: Tim Bannister <[email protected]> * Revisions * Update content/en/docs/tasks/administer-cluster/memory-manager.md Co-authored-by: Qiming Teng <[email protected]> * Revisions Co-authored-by: Tim Bannister <[email protected]> Co-authored-by: Qiming Teng <[email protected]>
1 parent 0003894 commit 11c8889

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ service PodResourcesLister {
199199

200200
The `List` endpoint provides information on resources of running pods, with details such as the
201201
id of exclusively allocated CPUs, device id as it was reported by device plugins and id of
202-
the NUMA node where these devices are allocated.
202+
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.
203203

204204
```gRPC
205205
// ListPodResourcesResponse is the response returned by List function
@@ -219,6 +219,14 @@ message ContainerResources {
219219
string name = 1;
220220
repeated ContainerDevices devices = 2;
221221
repeated int64 cpu_ids = 3;
222+
repeated ContainerMemory memory = 4;
223+
}
224+
225+
// ContainerMemory contains information about memory and hugepages assigned to a container
226+
message ContainerMemory {
227+
string memory_type = 1;
228+
uint64 size = 2;
229+
TopologyInfo topology = 3;
222230
}
223231
224232
// Topology describes hardware topology of the resource
@@ -247,6 +255,7 @@ It provides more information than kubelet exports to APIServer.
247255
message AllocatableResourcesResponse {
248256
repeated ContainerDevices devices = 1;
249257
repeated int64 cpu_ids = 2;
258+
repeated ContainerMemory memory = 3;
250259
}
251260
252261
```

content/en/docs/tasks/administer-cluster/memory-manager.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Memory Manager
2+
title: Utilizing the NUMA-aware Memory Manager
33

44
reviewers:
55
- klueska
@@ -11,7 +11,7 @@ min-kubernetes-server-version: v1.21
1111

1212
<!-- overview -->
1313

14-
{{< feature-state state="alpha" for_k8s_version="v1.21" >}}
14+
{{< feature-state state="beta" for_k8s_version="v1.22" >}}
1515

1616
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" >}}.
1717

@@ -29,12 +29,14 @@ To align memory resources with other requested resources in a Pod Spec:
2929
- 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/);
3030
- 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/).
3131

32-
Support for the Memory Manager requires `MemoryManager` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
32+
Starting from v1.22, the Memory Manager is enabled by default through `MemoryManager` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
3333

34-
That is, the `kubelet` must be started with the following flag:
34+
Preceding v1.22, the `kubelet` must be started with the following flag:
3535

3636
`--feature-gates=MemoryManager=true`
3737

38+
in order to enable the Memory Manager feature.
39+
3840
## How Memory Manager Operates?
3941

4042
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
211213
- pod status - indicates topology affinity errors
212214
- system logs - include valuable information for debugging, e.g., about generated hints
213215
- state file - the dump of internal state of the Memory Manager (includes [Node Map and Memory Maps][2])
216+
- starting from v1.22, the [device plugin resource API](#device-plugin-resource-api) can be used
217+
to retrieve information about the memory reserved for containers
218+
219+
214220

215221
### Pod status (TopologyAffinityError) {#TopologyAffinityError}
216222

@@ -358,6 +364,10 @@ For example, the total amount of free "conventional" memory in the group can be
358364

359365
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.
360366

367+
### Device plugin resource API
368+
369+
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.
370+
361371
## {{% heading "whatsnext" %}}
362372

363373
- [Memory Manager KEP: Design Overview][4]

0 commit comments

Comments
 (0)