当其他POD掉落时,是否可以将POD缩放到0副本?我熟悉水平自动缩放概念的基础知识,但是据我了解,它仅在需要资源时就可以向上或向下缩放豆荚(CPU,CPU,内存)更改。
我的CI管道遵循绿色/蓝色模式,因此,当新版本部署了新版本时,第二个应用程序将缩放到0副本,而其他属于同一环境的POD则在浪费资源上。您是否知道如何使用Kubernetes或Helm功能来解决它?
谢谢
Is it possible to scale down a pod to 0 replicas when other pod is down?I'm familiar with the basics of the Horizontal Auto-Scaling concept, but as I understand it scales pod up or down only when demands for resources (CPU, memory) changes.
My CI pipeline follows a green/blue pattern, so when the new version of the application is being deployed the second one is scaled down to 0 replicas, leaving other pods belonging to the same environment up wasting resources. Do you have any idea how to solve it using kubernetes or helm features?
Thanks
发布评论
评论(1)
如果您有一个 ci 管道,则可以在部署蓝绿色之前运行kubectl命令并缩小部署的扩展,以免使用任何资源浪费。
但是,是的,您可以根据自定义指标扩展上/下部署或应用程序。
我建议您检查云本地项目 keda : https://keda.sh/
keda :
示例
比例对象参考:
If you have a CI pipeline you can just run the kubectl command and scale down the deployment before deploying the blue-green this way no resource wasting will be there.
However yes, you can scale UP/DOWN the deployment or application based on the custom metrics.
i would recommend you checking out Cloud-native project Keda : https://keda.sh/
Keda:
Example
Scale object ref : https://keda.sh/docs/1.4/concepts/scaling-deployments/#scaledobject-spec