kubernetes自动缩放错误custome metriccs

irp*_*abu 4 kubernetes

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

Run Code Online (Sandbox Code Playgroud)

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

$ kubectl version --short

Client Version: v1.18.0
Server Version: v1.14.9-eks-502bfb
Run Code Online (Sandbox Code Playgroud)

Mar*_*kow 6

您可以通过运行以下命令来检查可用字段:

kubectl explain --api-version=autoscaling/v2beta2 HorizontalPodAutoscaler.spec
Run Code Online (Sandbox Code Playgroud)

哪个是: 在此输入图像描述