Skip to content

Commit a10f9da

Browse files
authored
Swap cpu and memory in HPA template (#3773)
1 parent 9e6e608 commit a10f9da

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

deployments/helm-chart/templates/controller-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ metadata:
1010
annotations: {{ toYaml .Values.controller.annotations | nindent 4 }}
1111
{{- end }}
1212
spec:
13+
{{- if not .Values.controller.autoscaling.enabled }}
1314
replicas: {{ .Values.controller.replicaCount }}
15+
{{- end }}
1416
selector:
1517
matchLabels:
1618
{{- include "nginx-ingress.selectorLabels" . | nindent 6 }}

deployments/helm-chart/templates/controller-hpa.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ spec:
1818
minReplicas: {{ .Values.controller.autoscaling.minReplicas }}
1919
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
2020
metrics:
21-
{{- if .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
21+
{{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
2222
- type: Resource
2323
resource:
24-
name: cpu
24+
name: memory
2525
target:
2626
type: Utilization
27-
averageUtilization: {{ .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
27+
averageUtilization: {{ .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
2828
{{- end }}
29-
{{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
29+
{{- if .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
3030
- type: Resource
3131
resource:
32-
name: memory
32+
name: cpu
3333
target:
3434
type: Utilization
35-
averageUtilization: {{ .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
35+
averageUtilization: {{ .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
3636
{{- end }}
3737
{{- end }}

0 commit comments

Comments
 (0)