GKE 節點自動配置未依定義的限制進行擴展

GKE 節點自動配置未依定義的限制進行擴展

我想使用 GKE 節點自動配置來按需建立具有 GPU 的節點池(即當我啟動需要 GPU 資源的作業時)。

按照 GCP 教程,我設定了一個啟用了cluster autoscaling和 的叢集node auto-provisioning。 NAP為CPU、記憶體和GPU設定了限制:

resourceLimits:
  - maximum: '15'
    minimum: '1'
    resourceType: cpu
  - maximum: '150'
    minimum: '1'
    resourceType: memory
  - maximum: '2'
    resourceType: nvidia-tesla-k80

我知道 NAP 有效,因為它已經為我啟動了一些節點,但它們都是「普通節點」(沒有 GPU)。

現在,「強制」NAP 使用 GPU 機器建立節點池。在此之前,叢集上不存在GPU節點。為此,我使用這樣的設定檔建立一個作業:

apiVersion: batch/v1
kind: Job
metadata:
  name: training-job
spec:
  ttlSecondsAfterFinished: 100
  template:
    metadata:
      name: training-job
    spec:
      nodeSelector:
        gpu: "true"
        cloud.google.com/gke-spot: "true"
        cloud.google.com/gke-accelerator: nvidia-tesla-k80
      tolerations:
        - key: cloud.google.com/gke-spot
          operator: Equal
          value: "true"
          effect: NoSchedule
      containers:
        - name: gpu-test
          image: przomys/gpu-test
          resources:
            requests:
              cpu: 500m
            limits:
              nvidia.com/gpu: 2 # requesting 2 GPU
      restartPolicy: Never # Do not restart containers after they exit

正在建立作業,但隨後它被標記為「不可調度」並且 CA Log 給我這樣的錯誤:

{
  "noDecisionStatus": {
    "measureTime": "1650370630",
    "noScaleUp": {
      "unhandledPodGroups": [
        {
          "rejectedMigs": [
            {
              "reason": {
                "messageId": "no.scale.up.mig.failing.predicate",
                "parameters": [
                  "NodeAffinity",
                  "node(s) didn't match Pod's node affinity/selector"
                ]
              },
              "mig": {
                "zone": "us-central1-c",
                "nodepool": "pool-3",
                "name": "gke-cluster-activeid-pool-3-af526144-grp"
              }
            },
            {
              "mig": {
                "name": "gke-cluster-activeid-nap-e2-standard--c7a4d4f1-grp",
                "zone": "us-central1-c",
                "nodepool": "nap-e2-standard-2-w52e84k8"
              },
              "reason": {
                "parameters": [
                  "NodeAffinity",
                  "node(s) didn't match Pod's node affinity/selector"
                ],
                "messageId": "no.scale.up.mig.failing.predicate"
              }
            }
          ],
          "napFailureReasons": [
            {
              "parameters": [
                "Any GPU."
              ],
              "messageId": "no.scale.up.nap.pod.gpu.no.limit.defined"
            }
          ],
          "podGroup": {
            "totalPodCount": 1,
            "samplePod": {
              "controller": {
                "apiVersion": "batch/v1",
                "kind": "Job",
                "name": "training-job"
              },
              "namespace": "default",
              "name": "training-job-7k8zd"
            }
          }
        }
      ],
      "unhandledPodGroupsTotalCount": 1
    }
  }
}

我的猜測是no.scale.up.nap.pod.gpu.no.limit.define是最重要的部分。GCP教程指點我這裡。但我已經定義了這個限制,因此我沒有想法...

也許有人知道我做錯了什麼?

相關內容