This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.6.5. NUMA 対応スケジューラーを使用したワークロードのスケジューリング
ワークロードを処理するために最低限必要なリソースを指定する Deployment
CR を使用して、NUMA 対応スケジューラーでワークロードをスケジュールできます。
次のデプロイメント例では、サンプルワークロードに NUMA 対応のスケジューリングを使用します。
前提条件
-
OpenShift CLI (
oc
) がインストールされている。 -
cluster-admin
権限を持つユーザーとしてログインしている。 - NUMA Resources Operator をインストールし、NUMA 対応のセカンダリースケジューラーをデプロイします。
手順
次のコマンドを実行して、クラスターにデプロイされている NUMA 対応スケジューラーの名前を取得します。
$ oc get numaresourcesschedulers.nodetopology.openshift.io numaresourcesscheduler -o json | jq '.status.schedulerName'
出力例
topo-aware-scheduler
topo-aware-scheduler
という名前のスケジューラーを使用するDeployment
CR を作成します。次に例を示します。以下の YAML を
nro-deployment.yaml
ファイルに保存します。apiVersion: apps/v1 kind: Deployment metadata: name: numa-deployment-1 namespace: openshift-numaresources spec: replicas: 1 selector: matchLabels: app: test template: metadata: labels: app: test spec: schedulerName: topo-aware-scheduler 1 containers: - name: ctnr image: quay.io/openshifttest/hello-openshift:openshift imagePullPolicy: IfNotPresent resources: limits: memory: "100Mi" cpu: "10" requests: memory: "100Mi" cpu: "10" - name: ctnr2 image: registry.access.redhat.com/rhel:latest imagePullPolicy: IfNotPresent command: ["/bin/sh", "-c"] args: [ "while true; do sleep 1h; done;" ] resources: limits: memory: "100Mi" cpu: "8" requests: memory: "100Mi" cpu: "8"
- 1
schedulerName
は、クラスターにデプロイされている NUMA 対応のスケジューラーの名前 (topo-aware-scheduler
など) と一致する必要があります。
次のコマンドを実行して、
Deployment
CR を作成します。$ oc create -f nro-deployment.yaml
検証
デプロイメントが正常に行われたことを確認します。
$ oc get pods -n openshift-numaresources
出力例
NAME READY STATUS RESTARTS AGE numa-deployment-1-56954b7b46-pfgw8 2/2 Running 0 129m numaresources-controller-manager-7575848485-bns4s 1/1 Running 0 15h numaresourcesoperator-worker-dvj4n 2/2 Running 0 18h numaresourcesoperator-worker-lcg4t 2/2 Running 0 16h secondary-scheduler-56994cf6cf-7qf4q 1/1 Running 0 18h
次のコマンドを実行して、
topo-aware-scheduler
がデプロイされた Pod をスケジュールしていることを確認します。$ oc describe pod numa-deployment-1-56954b7b46-pfgw8 -n openshift-numaresources
出力例
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 130m topo-aware-scheduler Successfully assigned openshift-numaresources/numa-deployment-1-56954b7b46-pfgw8 to compute-0.example.com
注記スケジューリングに使用可能なリソースよりも多くのリソースを要求するデプロイメントは、
MinimumReplicasUnavailable
エラーで失敗します。必要なリソースが利用可能になると、デプロイメントは成功します。Pod は、必要なリソースが利用可能になるまでPending
状態のままになります。ノードに割り当てられる予定のリソースがリスト表示されていることを確認します。以下のコマンドを実行します。
$ oc describe noderesourcetopologies.topology.node.k8s.io
出力例
... Zones: Costs: Name: node-0 Value: 10 Name: node-1 Value: 21 Name: node-0 Resources: Allocatable: 39 Available: 21 1 Capacity: 40 Name: cpu Allocatable: 6442450944 Available: 6442450944 Capacity: 6442450944 Name: hugepages-1Gi Allocatable: 134217728 Available: 134217728 Capacity: 134217728 Name: hugepages-2Mi Allocatable: 262415904768 Available: 262206189568 Capacity: 270146007040 Name: memory Type: Node
- 1
- 保証された Pod に割り当てられたリソースが原因で、
Available
な容量が減少しています。
保証された Pod によって消費されるリソースは、
noderesourcetopologies.topology.node.k8s.io
にリスト表示されている使用可能なノードリソースから差し引かれます。Best-effort
またはBurstable の
サービス品質 (qosClass
) を持つ Pod のリソース割り当てが、noderesourcetopologies.topology.node.k8s.io
の NUMA ノードリソースに反映されていません。Pod の消費リソースがノードリソースの計算に反映されない場合は、次のコマンドを実行して、Pod にGuaranteed
のqosClass
があることを確認します。$ oc get pod <pod_name> -n <pod_namespace> -o jsonpath="{ .status.qosClass }"
出力例
Guaranteed