File tree Expand file tree Collapse file tree 4 files changed +50
-4
lines changed Expand file tree Collapse file tree 4 files changed +50
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ metadata:
7
7
labels :
8
8
{{- include "chart.routerLabels" . | nindent 4 }}
9
9
spec :
10
+ {{- if .Values.routerSpec.autoscaling.enabled }}
11
+ replicas : {{ .Values.routerSpec.autoscaling.minReplicas }}
12
+ {{- else }}
10
13
replicas : {{ .Values.routerSpec.replicaCount }}
14
+ {{- end }}
11
15
{{- include "chart.routerStrategy" . | nindent 2 }}
12
16
selector :
13
17
matchLabels :
@@ -118,8 +122,12 @@ spec:
118
122
{{- end }}
119
123
{{- if .Values.routerSpec.resources.limits }}
120
124
limits :
125
+ {{- if .Values.routerSpec.resources.limits.cpu }}
121
126
cpu : " {{ .Values.routerSpec.resources.limits.cpu }}"
127
+ {{- end }}
128
+ {{- if .Values.routerSpec.resources.limits.memory }}
122
129
memory : " {{ .Values.routerSpec.resources.limits.memory }}"
130
+ {{- end }}
123
131
{{- end }}
124
132
{{- end }}
125
133
ports :
Original file line number Diff line number Diff line change
1
+ {{- if .Values.routerSpec.autoscaling.enabled -}}
2
+ apiVersion : autoscaling/v2
3
+ kind : HorizontalPodAutoscaler
4
+ metadata :
5
+ name : " {{ .Release.Name }}-router-hpa"
6
+ namespace : {{ .Release.Namespace }}
7
+ labels :
8
+ {{- include "chart.routerLabels" . | nindent 4 }}
9
+ spec :
10
+ scaleTargetRef :
11
+ apiVersion : apps/v1
12
+ kind : Deployment
13
+ name : " {{ .Release.Name }}-deployment-router"
14
+ minReplicas : {{ .Values.routerSpec.autoscaling.minReplicas }}
15
+ maxReplicas : {{ .Values.routerSpec.autoscaling.maxReplicas }}
16
+ metrics :
17
+ - type : Resource
18
+ resource :
19
+ name : cpu
20
+ target :
21
+ type : Utilization
22
+ averageUtilization : {{ .Values.routerSpec.autoscaling.targetCPUUtilizationPercentage }}
23
+ {{- end -}}
Original file line number Diff line number Diff line change 398
398
"replicaCount" : {
399
399
"type" : " integer"
400
400
},
401
+ "autoscaling" : {
402
+ "type" : " object" ,
403
+ "properties" : {
404
+ "enabled" : {"type" : " boolean" },
405
+ "minReplicas" : {"type" : " integer" },
406
+ "maxReplicas" : {"type" : " integer" },
407
+ "targetCPUUtilizationPercentage" : {"type" : " integer" }
408
+ }
409
+ },
401
410
"containerPort" : {
402
411
"type" : " integer"
403
412
},
Original file line number Diff line number Diff line change @@ -268,6 +268,13 @@ routerSpec:
268
268
# -- Number of replicas
269
269
replicaCount : 1
270
270
271
+ # -- autoscaling configuration
272
+ autoscaling :
273
+ enabled : false
274
+ minReplicas : 1
275
+ maxReplicas : 3
276
+ targetCPUUtilizationPercentage : 80
277
+
271
278
# -- Priority Class
272
279
priorityClassName : " "
273
280
@@ -314,11 +321,10 @@ routerSpec:
314
321
# -- router resource requests and limits
315
322
resources :
316
323
requests :
317
- cpu : " 4 "
318
- memory : " 16G "
324
+ cpu : 400m
325
+ memory : 500Mi
319
326
limits :
320
- cpu : " 8"
321
- memory : " 32G"
327
+ memory : 500Mi
322
328
323
329
# -- Customized labels for the router deployment
324
330
labels :
You can’t perform that action at this time.
0 commit comments