diff --git a/charts/podinfo/templates/hpa.yaml b/charts/podinfo/templates/hpa.yaml index 6d768ae01..a6e07b76c 100644 --- a/charts/podinfo/templates/hpa.yaml +++ b/charts/podinfo/templates/hpa.yaml @@ -13,14 +13,6 @@ spec: minReplicas: {{ .Values.replicaCount }} maxReplicas: {{ .Values.hpa.maxReplicas }} metrics: - {{- if .Values.hpa.cpu }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.hpa.cpu }} - {{- end }} {{- if .Values.hpa.memory }} - type: Resource resource: @@ -29,6 +21,14 @@ spec: type: AverageValue averageValue: {{ .Values.hpa.memory }} {{- end }} + {{- if .Values.hpa.cpu }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.hpa.cpu }} + {{- end }} {{- if .Values.hpa.requests }} - type: Pods pods: