[英]Kubernetes customized controller for collaborated auto scaling
I am very new to Kube.netes CRD and customized controller. I am trying to implement a customized controller that horizontally scale my CRD instances in a collaborated way.我是 Kube.netes CRD 和自定义 controller 的新手。我正在尝试实现一个自定义的 controller,它以协作的方式水平扩展我的 CRD 实例。 For example, suppose I have 5 CPUs and two Jobs.
例如,假设我有 5 个 CPU 和两个作业。 Each of them has 2 replicas and each replica run on one CPU:
它们每个都有 2 个副本,每个副本在一个 CPU 上运行:
Jobs Replicas CPU
------------------------
Alice 2 2
Bob 2 2
Now, assume some events happen and both Jobs decide to scale to 3 replicas.现在,假设发生了一些事件并且两个作业都决定扩展到 3 个副本。 But since I have only 5 CPUs, only one Job can scale up.
但是因为我只有 5 个 CPU,所以只有一个 Job 可以扩展。 So my question is, how can I implement my logic in the controller so that the Jobs can agree who should take the resources?
所以我的问题是,我如何在 controller 中实现我的逻辑,以便乔布斯可以同意谁应该占用资源?
I just read through the kubebuilder tutorial.我刚刚通读了kubebuilder教程。 The examples only show how to scale Jobs independently.
这些示例仅展示了如何独立扩展作业。 It's not clear to me how can I resolve the resource conflict situation in a collaborated way.
我不清楚如何以协作方式解决资源冲突情况。
For this, you can add a new parameter for jobs ie priority and on the basis of that you can resolve resource conflict.为此,您可以为作业添加一个新参数,即优先级,并在此基础上解决资源冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.