为什么Horizontal Pod Autoscaler Yaml出现错误


2022-08-17T16:14:15.5682728Z error: error validating "deployment.yml": error validating data: ValidationError(HorizontalPodAutoscaler.spec.metrics[1].resource.target.averageUtilization): invalid type for io.k8s.api.autoscaling.v2.MetricTarget.averageUtilization: got "string", expected "integer"; if you choose to ignore these errors, turn validation off with --validate=false
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: hpa-xyz
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: XYZ
minReplicas: ${MinRequestForwarderReplicas}
maxReplicas: ${MaxRequestForwarderReplicas}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 1500Mi

我试着回忆";平均利用率";值为1.5Gi;1.5Gi";用双引号。有人能检查一下并告诉我这里有没有遗漏什么吗?

averageUtilization: 

表示为请求内存的百分比。所以你错了Mi

应该是。

averageUtilization: 65 

指定averageUtilization和所有pod的目标平均内存利用率,以请求内存的百分比表示。目标pod必须配置内存请求。

相关内容

  • 没有找到相关文章

最新更新