6.4. 部署 NUMA 感知辅助 pod 调度程序
安装 NUMA Resources Operator 后,执行以下操作来部署 NUMA 感知辅助 pod 调度程序:
- 为所需机器配置集配置 pod admittance 策略
- 创建所需的机器配置池
- 部署 NUMA 感知二级调度程序
先决条件
-
安装 OpenShift CLI(
oc
)。 -
以具有
cluster-admin
特权的用户身份登录。 - 安装 NUMA Resources Operator。
流程
创建
KubeletConfig
自定义资源,为机器配置集配置 pod admittance 策略:将以下 YAML 保存到
nro-kubeletconfig.yaml
文件中:apiVersion: machineconfiguration.openshift.io/v1 kind: KubeletConfig metadata: name: cnf-worker-tuning spec: machineConfigPoolSelector: matchLabels: cnf-worker-tuning: enabled kubeletConfig: cpuManagerPolicy: "static" 1 cpuManagerReconcilePeriod: "5s" reservedSystemCPUs: "0,1" memoryManagerPolicy: "Static" 2 evictionHard: memory.available: "100Mi" kubeReserved: memory: "512Mi" reservedMemory: - numaNode: 0 limits: memory: "1124Mi" systemReserved: memory: "512Mi" topologyManagerPolicy: "single-numa-node" 3 topologyManagerScope: "pod"
运行以下命令来创建
KubeletConfig
自定义资源 (CR):$ oc create -f nro-kubeletconfig.yaml
创建
NUMAResourcesScheduler
自定义资源来部署 NUMA 感知自定义 pod 调度程序:将以下 YAML 保存到
nro-scheduler.yaml
文件中:apiVersion: nodetopology.openshift.io/v1alpha1 kind: NUMAResourcesScheduler metadata: name: numaresourcesscheduler spec: imageSpec: "registry.redhat.io/openshift4/noderesourcetopology-scheduler-container-rhel8:v4.11"
运行以下命令来创建
NUMAResourcesScheduler
CR:$ oc create -f nro-scheduler.yaml
验证
运行以下命令验证所需资源是否已成功部署:
$ oc get all -n openshift-numaresources
输出示例
NAME READY STATUS RESTARTS AGE pod/numaresources-controller-manager-7575848485-bns4s 1/1 Running 0 13m pod/numaresourcesoperator-worker-dvj4n 2/2 Running 0 16m pod/numaresourcesoperator-worker-lcg4t 2/2 Running 0 16m pod/secondary-scheduler-56994cf6cf-7qf4q 1/1 Running 0 16m NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE daemonset.apps/numaresourcesoperator-worker 2 2 2 2 2 node-role.kubernetes.io/worker= 16m NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/numaresources-controller-manager 1/1 1 1 13m deployment.apps/secondary-scheduler 1/1 1 1 16m NAME DESIRED CURRENT READY AGE replicaset.apps/numaresources-controller-manager-7575848485 1 1 1 13m replicaset.apps/secondary-scheduler-56994cf6cf 1 1 1 16m