diff --git a/charts/prometheus-statsd-exporter/Chart.yaml b/charts/prometheus-statsd-exporter/Chart.yaml index 0af866b1230d..a6786948075a 100644 --- a/charts/prometheus-statsd-exporter/Chart.yaml +++ b/charts/prometheus-statsd-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus-statsd-exporter description: A Helm chart for prometheus stats-exporter -version: 0.11.0 +version: 0.11.1 appVersion: v0.26.0 home: https://github.com/prometheus/statsd_exporter sources: diff --git a/charts/prometheus-statsd-exporter/templates/hpa.yaml b/charts/prometheus-statsd-exporter/templates/hpa.yaml index 9c0fa614b072..b48caae3df2e 100644 --- a/charts/prometheus-statsd-exporter/templates/hpa.yaml +++ b/charts/prometheus-statsd-exporter/templates/hpa.yaml @@ -14,14 +14,6 @@ spec: maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: {{- if eq (include "prometheus-statsd-exporter.hpa.apiVersion" .) "autoscaling/v2" -}} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: @@ -30,18 +22,26 @@ spec: type: Utilization averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} - {{- else -}} {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} + {{- else -}} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end -}} + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} {{- end }}