【问题标题】:How to isolate some Containers from Kubernetes Horizontal Pod Autoscaler如何从 Kubernetes Horizo​​ntal Pod Autoscaler 中隔离一些容器
【发布时间】:2019-11-25 11:16:22
【问题描述】:

使用为 Deployment 实施的 Horizo​​ntal Pod Autoscaler 运行具有两个不同容器的 PodContainers-AContaner-B,我想确保它只缩放 Container-A 的数量。 Container-B 的数量应该始终相同,并且不受 Pod 的 Autoscaler 的影响。我想知道是否可以将 Container-B 从 Autoscaler 中分离出来。如果可以,如何实现?

kubectl autoscale my-deployment --min=10 --max=15 --cpu-percent=80

【问题讨论】:

    标签: docker kubernetes containers amazon-eks


    【解决方案1】:

    顾名思义,“Horizo​​ntal Pod Autoscaler” 缩放 pod,而不是容器。

    但是,我看不出您想要这种行为的原因。

    You should have more than one container in a Pod only if those containers are tightly coupled together and need to share resources. 您想独立扩展容器 A 和 B 的事实告诉我,这些容器不是紧密耦合的。

    我会建议以下方法:

    1. 使用容器 A 管理 Pod 的部署 A。 Autoscaler 只会为这个部署扩展 Pod。

    2. 使用容器 B 管理 Pod 的部署 B。此部署不会受到自动扩缩器的影响。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-16
      • 1970-01-01
      • 2019-12-10
      • 2021-06-01
      • 2018-10-09
      • 2018-10-09
      • 2023-03-26
      • 2020-02-05
      相关资源
      最近更新 更多