【问题标题】:kubernetes autoscaling error custome metriccskubernetes 自动缩放错误custome metriccs
【发布时间】:2020-07-09 04:06:01
【问题描述】:
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: busy-autoscaler
spec:
   behavior:
     scaleDown:
       stabilizationWindowSeconds: 10
       policies:
       - type: Percent
         value: 50
         periodSeconds: 15
   scaleTargetRef:
     apiVersion: apps/v1
     kind: Deployment
     name: busy-worker
   minReplicas: 1
   maxReplicas: 2
   metrics:
   - type: Resource
     resource:
       name: cpu
       target:
         type: Utilization
         averageUtilization: 50

错误:验证“hpa.yml”时出错:验证数据时出错:ValidationError(Horizo​​ntalPodAutoscaler.spec): io.k8s.api.autoscaling.v2beta2.Horizo​​ntalPodAutoscalerSpec 中的未知字段“behavior”;如果您选择忽略这些错误,请使用 --validate=false 关闭验证

$ kubectl version --short

Client Version: v1.18.0
Server Version: v1.14.9-eks-502bfb

【问题讨论】:

标签: kubernetes


【解决方案1】:

您可以通过运行检查可用字段:

kubectl explain --api-version=autoscaling/v2beta2 HorizontalPodAutoscaler.spec

它们是:

【讨论】:

    【解决方案2】:

    首先确保kubectl api-versions 显示自动缩放/v2beta2 已启用。

    您的服务器版本可能也有问题 - v1.14.9-eks-502bfb。

    查看更多:metrics-server。 如果有帮助,请告诉我。

    【讨论】:

      猜你喜欢
      • 2018-12-13
      • 1970-01-01
      • 2020-11-25
      • 2021-04-07
      • 2017-01-18
      • 2021-01-26
      • 2019-08-07
      • 2016-09-04
      • 1970-01-01
      相关资源
      最近更新 更多