简体   繁体   English

如何在 Kubernetes 中按需启动 Pod?

[英]How to start pods on demand in Kubernetes?

I need to create pods on demand in order to run a program.我需要按需创建 pod 才能运行程序。 it will run according to the needs, so it could be that for 5 hours there will be nothing running, and then 10 requests will be needed to process, and I might need to limit that only 5 will run simultaneously because of resources limitations.它会根据需要运行,所以可能5个小时没有运行,然后需要处理10个请求,由于资源限制,我可能需要限制只有5个同时运行。

I am not sure how to build such a thing in kubernetes.我不确定如何在 kubernetes 中构建这样的东西。

Also worth noting is that I would like to create a new docker container for each run and exit the container when it ends.另外值得注意的是,我想为每次运行创建一个新的 docker 容器,并在容器结束时退出容器。

There are many options and you'll need to try them out.有很多选择,您需要尝试一下。 The core tool is HorizontalPodAutoscaler.核心工具是 HorizontalPodAutoscaler。 Systems like KEDA build on top of that to manage metrics more easily.像 KEDA 这样的系统建立在此之上,可以更轻松地管理指标。 There's also Serverless tools like knative or kubeless.还有无服务器工具,如 knative 或 kubeless。 Or workflow tools like Tekton, Dagster, or Argo.或者像 Tekton、Dagster 或 Argo 这样的工作流工具。

It really depends on your specifics.这真的取决于你的具体情况。

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

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