来自节点池的 GKE 上不可调度的 GPU 工作负载

Unschedulable GPU workload on GKE from node pool

我是 运行 GKE Standard 上的 GPU 密集型按需工作负载,我在其中创建了包含最少 0 个和最多 5 个节点的适当节点池。但是,在节点池上调度作业时,GKE 会出现以下错误:

Events:
  Type     Reason             Age                From                Message
  ----     ------             ----               ----                -------
  Warning  FailedScheduling   59s (x2 over 60s)  default-scheduler   0/1 nodes are available: 1 node(s) didn't match Pod's node affinity/selector.
  Normal   NotTriggerScaleUp  58s                cluster-autoscaler  pod didn't trigger scale-up: 1 node(s) had taint {nvidia.com/gpu: present}, that the pod didn't tolerate, 1 in backoff after failed scale-up

我已经根据文档设置了 nodeSelector 并启用了自动缩放,我可以确认它确实找到了节点池,尽管出现“不匹配 Pod 的节点 affinity/selector”的错误并尝试扩展集群。但是此后不久它就失败了,说 0/1 节点可用?这是完全错误的,看到节点池中使用了 0/5 个节点。我在这里做错了什么?

1 node(s) had taint {nvidia.com/gpu: present}, that the pod didn't tolerate...

尝试将 tolerations 添加到您的作业的 pod 规范中:

...
spec:
  containers:
  - name: ...
    ...
  tolerations:
  - key: nvidia.com/gpu
    value: present
    operator: Exists
  

对于 node(s) didn't match Pod's node 你没有分享清单文件的详细信息,但假设他有以下几行:

nodeSelector: 
nodePool: cluster

您可以选择从 YAML 文件中删除这些行。或者,另一种选择是将 nodePool: cluster 作为标签添加到所有节点,然后使用可用的选择器来调度 pod。以下命令可能对您有用:

kubectl label nodes <your node name> nodePool=cluster

关于 1 node(s) had taint {nvidia.com/gpu: present}, that the pod didn't tolerate 消息,您可以按照 @gohm'c 的建议进行操作,或者您也可以使用以下命令删除 taint 来自主节点,这样你应该能够在该节点上安排你的 pod:

kubectl taint nodes  <your node name> node-role.kubernetes.io/master-
kubectl taint nodes  <your node name> node-role.kubernetes.io/master-

您可以参考以下线程,它们有真实案例的信息, and