1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/nw-sriov-topology-manager.adoc

82 lines
2.6 KiB
Plaintext

// Module included in the following assemblies:
//
// * networking/hardware_networks/configuring-sriov-device.adoc
:_mod-docs-content-type: PROCEDURE
[id="nw-sriov-topology-manager_{context}"]
= Creating a non-uniform memory access (NUMA) aligned SR-IOV pod
You can create a NUMA aligned SR-IOV pod by restricting SR-IOV and the CPU resources allocated from the same NUMA node with `restricted` or `single-numa-node` Topology Manager policies.
.Prerequisites
* You have installed the OpenShift CLI (`oc`).
* You have configured the CPU Manager policy to `static`. For more information on CPU Manager, see the "Additional resources" section.
* You have configured the Topology Manager policy to `single-numa-node`.
+
[NOTE]
====
When `single-numa-node` is unable to satisfy the request, you can configure the Topology Manager policy to `restricted`. For more flexible SR-IOV network resource scheduling, see _Excluding SR-IOV network topology during NUMA-aware scheduling_ in the _Additional resources_ section.
====
.Procedure
. Create the following SR-IOV pod spec, and then save the YAML in the `<name>-sriov-pod.yaml` file. Replace `<name>` with a name for this pod.
+
The following example shows an SR-IOV pod spec:
+
[source,yaml]
----
apiVersion: v1
kind: Pod
metadata:
name: sample-pod
annotations:
k8s.v1.cni.cncf.io/networks: <name> <1>
spec:
containers:
- name: sample-container
image: <image> <2>
command: ["sleep", "infinity"]
resources:
limits:
memory: "1Gi" <3>
cpu: "2" <4>
requests:
memory: "1Gi"
cpu: "2"
----
<1> Replace `<name>` with the name of the SR-IOV network attachment definition CR.
<2> Replace `<image>` with the name of the `sample-pod` image.
<3> To create the SR-IOV pod with guaranteed QoS, set `memory limits` equal to `memory requests`.
<4> To create the SR-IOV pod with guaranteed QoS, set `cpu limits` equals to `cpu requests`.
. Create the sample SR-IOV pod by running the following command:
+
[source,terminal]
----
$ oc create -f <filename> <1>
----
<1> Replace `<filename>` with the name of the file you created in the previous step.
. Confirm that the `sample-pod` is configured with guaranteed QoS.
+
[source,terminal]
----
$ oc describe pod sample-pod
----
. Confirm that the `sample-pod` is allocated with exclusive CPUs.
+
[source,terminal]
----
$ oc exec sample-pod -- cat /sys/fs/cgroup/cpuset/cpuset.cpus
----
. Confirm that the SR-IOV device and CPUs that are allocated for the `sample-pod` are on the same NUMA node.
+
[source,terminal]
----
$ oc exec sample-pod -- cat /sys/fs/cgroup/cpuset/cpuset.cpus
----