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라는 스케줄러를 사용하는배포CR을 생성합니다.nro-deployment.yaml파일에 다음 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-scheduler1 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).
다음 명령을 실행하여
DeploymentCR을 생성합니다.$ 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: 211 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에 할당된 리소스로 인해
사용 가능한용량이 줄어듭니다.
보장된 Pod에서 사용하는 리소스는 node
resourcetopology.node.k8s.io에 나열된 사용 가능한 노드리소스에서 차감됩니다.Best-effort또는Burstable서비스 품질(qosClass)이 있는 Pod의 리소스 할당은 noderesourcetopology.topology.node.k8s.io의 NUMA 노드리소스에 반영되지 않습니다. Pod의 소비된 리소스가 노드 리소스 계산에 반영되지 않은 경우 다음 명령을 실행하여 Pod에Guaranteed의qosClass가 있는지 확인합니다.$ oc get pod <pod_name> -n <pod_namespace> -o jsonpath="{ .status.qosClass }"출력 예
Guaranteed