简体   繁体   English

如何在特定时间内增加 kubernetes pod 的数量

[英]How to increase the number of kubernetes pods in a specific time

We are now using HPA to adjust the number of pods according to CPU and memory usage.我们现在正在使用 HPA 来根据 CPU 和 memory 使用情况调整 pod 的数量。

Also, I need a function that allows me to increase the pods at a specific time and end the pods after a while, but I wonder if there is a way.另外,我需要一个 function 允许我在特定时间增加 pod 并在一段时间后结束 pod,但我想知道是否有办法。

I am currently using AWS EKS and ArgoCD.我目前正在使用 AWS EKS 和 ArgoCD。

As far as I know, Kubernetes has no scheduled auto scaling policy so far.据我所知,Kubernetes 目前还没有预定的自动伸缩策略。 But if it were available, HPA and scheduled policy could be conflict.但如果它可用,HPA 和预定策略可能会发生冲突。

How about following idea:下面的想法怎么样:

Use Cron Job or API(kubectl patch etc..), and change minimum number of Pods in a HPA to the number what you want.使用 Cron Job 或 API(kubectl patch 等),并将 HPA 中的最小 Pod 数量更改为您想要的数量。 That is easy to increase the number of Pods and if you change the minimum number of Pods to the original number, HPA automatically adjust the number of Pods the system needs.这很容易增加 Pod 的数量,如果您将 Pod 的最小数量更改为原始数量,HPA 会自动调整系统需要的 Pod 数量。

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

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