【问题标题】:Kubernetes hpa cpu utilizationKubernetes hpa cpu 利用率
【发布时间】:2020-07-23 09:43:01
【问题描述】:

我发现 Istio 网关的 HPA 有问题。

为什么 10m 等于 10%? 10m 不是 1% 吗?

Kubernetes 版本为 1.18.5。

# kubectl get hpa --all-namespaces
NAMESPACE      NAME                   REFERENCE                         TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
istio-system   istio-egressgateway    Deployment/istio-egressgateway    7%/80%    2         10        2          13d
istio-system   istio-ingressgateway   Deployment/istio-ingressgateway   10%/80%   2         10        2          21d
istio-system   istiod                 Deployment/istiod                 0%/80%    1         5         1          21d
qa2            graph                  Deployment/graph                  2%/50%    1         10        1          7h35m
qa2            member                 Deployment/member                 0%/50%    1         10        1          7h38m
# kubectl describe hpa istio-ingressgateway -n istio-system | grep "resource cpu"
  resource cpu on pods  (as a percentage of request):  10% (10m) / 80%

# kubectl describe hpa istio-egressgateway -n istio-system | grep "resource cpu"
  resource cpu on pods  (as a percentage of request):  7% (7m) / 80%

# kubectl describe hpa istiod -n istio-system | grep "resource cpu"
  resource cpu on pods  (as a percentage of request):  0% (3m) / 80%

# kubectl describe hpa graph -n qa2 | grep "resource cpu"
  resource cpu on pods  (as a percentage of request):  2% (24m) / 50%

# kubectl describe hpa member -n qa2 | grep "resource cpu"
  resource cpu on pods  (as a percentage of request):  1% (12m) / 50%

【问题讨论】:

  • 你也可以分享你的 hpa yaml
  • 对不起。我修改了我的问题。只有网关 cpu 百分比是奇怪的。

标签: kubernetes hpa


【解决方案1】:

这些值不一样,也不是直接相互计算的。

百分比值是目标平均利用率(对应targetAverageUtilization参数),是相对于请求值的。

括号中的值是目标平均值 (targetAverageValue),不是以百分比衡量的 - 这是指标的绝对原始值。

【讨论】:

  • 我知道你的答案了。 istio-ingressgateway 的请求为 100m,因此 10m/100m 为 10%。并且对成员和图的请求是1(1000m)。
猜你喜欢
  • 2023-04-09
  • 1970-01-01
  • 2019-03-26
  • 2020-11-19
  • 2020-05-01
  • 2018-06-18
  • 2020-04-18
  • 1970-01-01
  • 2020-10-24
相关资源
最近更新 更多