Skip to content

Commit e970061

Browse files
author
Dmytro Sydorov
authored
fix: HPA target (#361)
Fixes an issue with HPA autoscaling/v2: * HorizontalPodAutoscaler.autoscaling "reflector" is invalid: [spec.metrics[0].resource.target.type: Required value: must specify a metric target type, spec.metrics[0].resource.target.type: Invalid value: "": must be either Utilization, Value, or AverageValue, spec.metrics[0].resource.target.averageUtilization: Required value: must set either a target raw value or a target utilization] Docs: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
1 parent 619e4bd commit e970061

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/helm/reflector/templates/hpa.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ spec:
1818
- type: Resource
1919
resource:
2020
name: cpu
21-
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
21+
target:
22+
type: Utilization
23+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
2224
{{- end }}
2325
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
2426
- type: Resource
2527
resource:
2628
name: memory
27-
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
29+
target:
30+
type: Utilization
31+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
2832
{{- end }}
2933
{{- end }}

0 commit comments

Comments
 (0)