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(HorizontalPodAutoscaler.spec):io.k8s.api.autoscaling.v2beta2.HorizontalPodAutoscalerSpec 中的未知字段“行为”;如果您选择忽略这些错误,请使用 --validate=false 关闭验证
$ kubectl version --short
Client Version: v1.18.0
Server Version: v1.14.9-eks-502bfb
Run Code Online (Sandbox Code Playgroud)
您可以通过运行以下命令来检查可用字段:
kubectl explain --api-version=autoscaling/v2beta2 HorizontalPodAutoscaler.spec
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4766 次 |
最近记录: |