gcloud kubernetes 节点池:可抢占 VM 节点的高优先级可能

gcloud kubernetes node pool: high priority for preemptible VM nodes possible

我需要一个解决方案:

我在 gcloud kubernetes 中有 2 个节点池,第一个是抢占式和自动缩放,第二个只是自动缩放。

作业应在第一个(具有抢占式 VM)上启动,但当第一个池中没有可用资源时作业应在第二个池上启动。

我怎么能意识到这一点,也许是通过 Taints 和 Tolerations?

我不认为您可以使用 Cluster Autoscaler 得到您想要的东西,但我希望能为您提供一些选项和指导以进一步探索。

  • Cluster Autoscaler 具有 Expanders which can help determine which node group to scale up when a scaling event happens. The price expander seems to be close to what you want, but based on the description of it, it doesn't look like it has support for preemptible VMs yet. You could explore that further, and possibly submit a feature request 的概念以添加对可抢占节点池的支持。
  • 混合选择可抢占和不可抢占节点时,每当GCP缺货,抢占节点不可用时,非抢占节点很可能会不可用。在那种情况下,您可能会发现自己在集群中只有少量不可抢占的节点,并且无法创建新节点。

    拥有一个固定的最小不可抢占节点大小,并使用集群自动缩放器在其之上自动缩放一个可抢占节点池可能是一个更好的主意。