横向 pod 自动缩放的外部指标 kubernetes.io|container|accelerator|duty_cycle 的 targetAverageValue 的单位是什么?
What is the unit of targetAverageValue for external metrics kubernetes.io|container|accelerator|duty_cycle for horizontal pod autoscaling?
我提到了这个 to set up my HPA(Horizontal Pod Autoscaler) for google kubernetes engine(gke) workload. According to the details of that question and the details specified here 我提到我的 targetAverageValue 是 50 应该被认为是 50% 但是当我 运行 命令 kubectl describe hpa 这是我在日志中注意到的行
Metrics: ( current / target ) "kubernetes.io|container|accelerator|duty_cycle" (target average value): 33500m / 50
这是我的 hpa yaml
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: gpu-metric
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: parabole-dj-u1
minReplicas: 1
maxReplicas: 5
metrics:
- type: External
external:
metricName: kubernetes.io|container|accelerator|duty_cycle
targetAverageValue: 50
好像是用其他单位测量的。如果我希望它以 50% 自动缩放,那么我的 targetAverageValue 应该是什么 duty_cycle?
从@Alberto Pau 询问的门户添加占空比指标的屏幕截图duty_cycle image
您的配置正确,HPA 始终以 mili 单位显示。
目前的利用率大概是33.5%,把带“m”的数字除以1000就可以得到百分比。
我提到了这个
Metrics: ( current / target ) "kubernetes.io|container|accelerator|duty_cycle" (target average value): 33500m / 50
这是我的 hpa yaml
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: gpu-metric
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: parabole-dj-u1
minReplicas: 1
maxReplicas: 5
metrics:
- type: External
external:
metricName: kubernetes.io|container|accelerator|duty_cycle
targetAverageValue: 50
好像是用其他单位测量的。如果我希望它以 50% 自动缩放,那么我的 targetAverageValue 应该是什么 duty_cycle?
从@Alberto Pau 询问的门户添加占空比指标的屏幕截图duty_cycle image
您的配置正确,HPA 始终以 mili 单位显示。 目前的利用率大概是33.5%,把带“m”的数字除以1000就可以得到百分比。