Skip to content

Commit

Permalink
Swap cpu and memory in HPA template (#3773)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbry95 authored Apr 19, 2023
1 parent 9e6e608 commit a10f9da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions deployments/helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ metadata:
annotations: {{ toYaml .Values.controller.annotations | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.controller.autoscaling.enabled }}
replicas: {{ .Values.controller.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "nginx-ingress.selectorLabels" . | nindent 6 }}
Expand Down
12 changes: 6 additions & 6 deletions deployments/helm-chart/templates/controller-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ spec:
minReplicas: {{ .Values.controller.autoscaling.minReplicas }}
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
metrics:
{{- if .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
{{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: cpu
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
averageUtilization: {{ .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
{{- if .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: memory
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
averageUtilization: {{ .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}

0 comments on commit a10f9da

Please sign in to comment.