简体   繁体   English

扩展 Kube.netes 集群以处理队列中的作业?

[英]Scaling a Kubernetes cluster to process jobs in a queue?

(I'm new to Kube.netes and not sure this is best practice) (我是 Kube.netes 的新手,不确定这是最佳实践)

I have a pipeline of jobs in a Firestore database that need to be completed as quickly as possible.我在 Firestore 数据库中有一系列作业需要尽快完成。

I want to set up a Kube.netes cluster (on GKE) that will scale up when there is a large backlog of tasks to complete.我想设置一个 Kube.netes 集群(在 GKE 上),当有大量积压的任务要完成时,它会扩展。 Each pod/node needs a single GPU to complete the task.每个 pod/node 都需要一个 GPU 来完成任务。

Is it possible to use a cloud function to manually scale the number of nodes depending on the number of jobs in the pipeline?是否可以使用云 function 根据管道中的作业数量手动缩放节点数量?

I was planning on using the clusters.nodePools.setSize() function from the GKE client library but I'm not sure if this is just intended for initial cluster setup rather than manual scaling.我计划使用 GKE 客户端库中的clusters.nodePools.setSize() function,但我不确定这是否仅用于初始集群设置而不是手动缩放。

Thanks谢谢

https://cloud.google.com/kube.netes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools/setSize https://cloud.google.com/kube.netes-engine/docs/reference/rest/v1beta1/projects.locations.clusters.nodePools/setSize

You can configure and use Horizontal pod scaling on your cluster to scale the number of Pods.您可以在集群上配置和使用 Horizontal pod scaling 来扩展 Pod 的数量。

As suggested by @somethingsomething refer these links on Horizontal Pod Autoscaler and Cluster autoscaler :正如@somethingsomething 所建议的,请参考 Horizontal Pod AutoscalerCluster autoscaler 上的这些链接:

The Horizontal Pod Autoscaler changes the shape of your Kube.netes workload by automatically increasing or decreasing the number of Pods in response to the workload's CPU or memory consumption, or in response to custom metrics reported from within Kube.netes or external metrics from sources outside of your cluster. Horizontal Pod Autoscaler 通过自动增加或减少 Pod 的数量来更改 Kube.netes 工作负载的形状,以响应工作负载的 CPU 或 memory 消耗,或响应从 Kube.netes 内部报告的自定义指标或来自外部来源的外部指标你的集群。

Horizontal Pod autoscaling helps to ensure that your workload functions consistently in different situations, and allows you to control costs by only paying for extra capacity when you need it. Horizontal Pod autoscaling 有助于确保您的工作负载在不同情况下始终如一地运行,并允许您通过仅在需要时为额外容量付费来控制成本。

It's not always easy to predict the indicators that show whether your workload is under-resourced or under-utilized.预测表明您的工作负载是资源不足还是利用不足的指标并不总是那么容易。 The Horizontal Pod Autoscaler can automatically scale the number of Pods in your workload based on one or more metrics. Horizontal Pod Autoscaler 可以根据一个或多个指标自动缩放工作负载中的 Pod 数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM