2

我在 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%

4

1 回答 1

3

这些值并不相同,并且它们不是直接相互计算的。

以百分比为单位的值是目标平均利用率(对应于targetAverageUtilization参数),它与请求的值相关。

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

于 2020-07-23T10:18:16.683 回答