我尝试将 HPA 与外部指标结合使用,将部署规模缩减至 0。我使用的 GKE 版本为 1.16.9-gke.2。
据此,我认为它会起作用,但事实并非如此。我仍然面临:The HorizontalPodAutoscaler "classifier" is invalid: spec.minReplicas: Invalid value: 0: must be greater than or equal to 1
以下是我的 HPA 定义:
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: classifier
spec:
minReplicas: 0
maxReplicas: 15
metrics:
- external:
metricName: loadbalancing.googleapis.com|https|request_count
targetAverageValue: "1"
type: External
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: classifier
Run Code Online (Sandbox Code Playgroud)
非常感谢你的帮助 !
autoscaling kubernetes google-kubernetes-engine kubernetes-deployment hpa