Skip to content

Commit 1e51ad8

Browse files
authored
specify hpa for individual service (#1506)
1 parent fdd8783 commit 1e51ad8

File tree

8 files changed

+73
-15
lines changed

8 files changed

+73
-15
lines changed

install/helm/open-match/subcharts/open-match-customize/templates/evaluator.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
apiVersion: apps/v1
5555
kind: Deployment
5656
name: {{ include "openmatch.evaluator.hostName" . }}
57-
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
57+
{{- include "openmatch.HorizontalPodAutoscaler.evaluator.spec.common" . | nindent 2 }}
5858
---
5959
apiVersion: apps/v1
6060
kind: Deployment

install/helm/open-match/subcharts/open-match-customize/templates/matchfunctions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
apiVersion: apps/v1
5555
kind: Deployment
5656
name: {{ include "openmatchcustomize.function.hostName" . }}
57-
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
57+
{{- include "openmatch.HorizontalPodAutoscaler.matchfunction.spec.common" . | nindent 2 }}
5858
---
5959
apiVersion: apps/v1
6060
kind: Deployment

install/helm/open-match/templates/_helpers.tpl

+28-4
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,34 @@ readinessProbe:
150150
failureThreshold: 2
151151
{{- end -}}
152152

153-
{{- define "openmatch.HorizontalPodAutoscaler.spec.common" -}}
154-
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.minReplicas }}
155-
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.maxReplicas }}
156-
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.targetCPUUtilizationPercentage }}
153+
{{- define "openmatch.HorizontalPodAutoscaler.frontend.spec.common" -}}
154+
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.frontend.minReplicas }}
155+
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.frontend.maxReplicas }}
156+
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.frontend.targetCPUUtilizationPercentage }}
157+
{{- end -}}
158+
159+
{{- define "openmatch.HorizontalPodAutoscaler.backend.spec.common" -}}
160+
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.backend.minReplicas }}
161+
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.backend.maxReplicas }}
162+
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.backend.targetCPUUtilizationPercentage }}
163+
{{- end -}}
164+
165+
{{- define "openmatch.HorizontalPodAutoscaler.query.spec.common" -}}
166+
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.query.minReplicas }}
167+
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.query.maxReplicas }}
168+
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.query.targetCPUUtilizationPercentage }}
169+
{{- end -}}
170+
171+
{{- define "openmatch.HorizontalPodAutoscaler.evaluator.spec.common" -}}
172+
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.evaluator.minReplicas }}
173+
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.evaluator.maxReplicas }}
174+
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.evaluator.targetCPUUtilizationPercentage }}
175+
{{- end -}}
176+
177+
{{- define "openmatch.HorizontalPodAutoscaler.matchfunction.spec.common" -}}
178+
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.matchfunction.minReplicas }}
179+
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.matchfunction.maxReplicas }}
180+
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.matchfunction.targetCPUUtilizationPercentage }}
157181
{{- end -}}
158182

159183
{{- define "openmatch.serviceAccount.name" -}}

install/helm/open-match/templates/backend.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
apiVersion: apps/v1
5252
kind: Deployment
5353
name: {{ include "openmatch.backend.hostName" . }}
54-
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
54+
{{- include "openmatch.HorizontalPodAutoscaler.backend.spec.common" . | nindent 2 }}
5555
---
5656
apiVersion: apps/v1
5757
kind: Deployment

install/helm/open-match/templates/frontend.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
apiVersion: apps/v1
5252
kind: Deployment
5353
name: {{ include "openmatch.frontend.hostName" . }}
54-
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
54+
{{- include "openmatch.HorizontalPodAutoscaler.frontend.spec.common" . | nindent 2 }}
5555
---
5656
apiVersion: apps/v1
5757
kind: Deployment

install/helm/open-match/templates/query.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
apiVersion: apps/v1
5252
kind: Deployment
5353
name: {{ include "openmatch.query.hostName" . }}
54-
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
54+
{{- include "openmatch.HorizontalPodAutoscaler.query.spec.common" . | nindent 2 }}
5555
---
5656
apiVersion: apps/v1
5757
kind: Deployment

install/helm/open-match/values-production.yaml

+20-3
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,26 @@ global:
240240
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
241241
affinity: {}
242242
horizontalPodAutoScaler:
243-
minReplicas: 3
244-
maxReplicas: 10
245-
targetCPUUtilizationPercentage: 60
243+
frontend:
244+
minReplicas: 3
245+
maxReplicas: 10
246+
targetCPUUtilizationPercentage: 60
247+
backend:
248+
minReplicas: 3
249+
maxReplicas: 10
250+
targetCPUUtilizationPercentage: 60
251+
query:
252+
minReplicas: 5
253+
maxReplicas: 10
254+
targetCPUUtilizationPercentage: 60
255+
evaluator:
256+
minReplicas: 3
257+
maxReplicas: 10
258+
targetCPUUtilizationPercentage: 60
259+
matchfunction:
260+
minReplicas: 3
261+
maxReplicas: 10
262+
targetCPUUtilizationPercentage: 60
246263
resources:
247264
requests:
248265
memory: 1.5Gi

install/helm/open-match/values.yaml

+20-3
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,26 @@ global:
238238
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
239239
affinity: {}
240240
horizontalPodAutoScaler:
241-
minReplicas: 1
242-
maxReplicas: 10
243-
targetCPUUtilizationPercentage: 80
241+
frontend:
242+
minReplicas: 1
243+
maxReplicas: 10
244+
targetCPUUtilizationPercentage: 80
245+
backend:
246+
minReplicas: 1
247+
maxReplicas: 10
248+
targetCPUUtilizationPercentage: 80
249+
query:
250+
minReplicas: 3
251+
maxReplicas: 10
252+
targetCPUUtilizationPercentage: 80
253+
evaluator:
254+
minReplicas: 1
255+
maxReplicas: 10
256+
targetCPUUtilizationPercentage: 80
257+
matchfunction:
258+
minReplicas: 1
259+
maxReplicas: 10
260+
targetCPUUtilizationPercentage: 80
244261
resources:
245262
requests:
246263
memory: 100Mi

0 commit comments

Comments
 (0)