简体   繁体   English

Kubernetes HPA 自定义扩展规则

[英]Kubernetes HPA custom scaling rules

I have a master-slave-like deployment, when the first pod starts (master node) it will be running on more powerful nodes and slaves on less powerful ones.我有一个类似主从的部署,当第一个 pod 启动时(主节点),它将在功能更强大的节点上运行,而从节点在功能较弱的节点上运行。

I am doing it using affinity/anti-affinity.我正在使用亲和力/反亲和力来做这件事。

Since both of them run the exact same binaries, I wanted to set to the autoscaler (HPA) some custom policy for the first and the other nodes, is there a way to do so?由于它们都运行完全相同的二进制文件,我想为第一个和其他节点的自动缩放器 (HPA) 设置一些自定义策略,有没有办法这样做?

Yes, there is a way to do it.是的,有一种方法可以做到。
You can write your own custom metric to support your desired logic您可以编写自己的自定义指标来支持您想要的逻辑

https://cloud.google.com/kubernetes-engine/docs/concepts/custom-and-external-metrics https://cloud.google.com/kubernetes-engine/docs/concepts/custom-and-external-metrics

You can also use projects like https://keda.sh/你也可以使用像https://keda.sh/这样的项目

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

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