File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
charts/nginx-gateway-fabric/templates Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ {{- if and (eq .Values.nginxGateway.kind "deployment") .Values.nginxGateway.autoscaling.enabled -}}
2
+ apiVersion : {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
3
+ kind : HorizontalPodAutoscaler
4
+ metadata :
5
+ {{- with .Values.autoscaling.annotations }}
6
+ annotations : {{ toYaml . | nindent 4 }}
7
+ {{- end }}
8
+ labels :
9
+ {{- include "nginx-gateway.labels" . | nindent 4 }}
10
+ {{- with .Values.nginxGateway.labels }}
11
+ {{- toYaml . | nindent 4 }}
12
+ {{- end }}
13
+ name : {{ include "nginx-gateway.fullname" . }}
14
+ namespace : {{ .Release.Namespace }}
15
+ spec :
16
+ scaleTargetRef :
17
+ apiVersion : apps/v1
18
+ kind : Deployment
19
+ name : {{ include "nginx-gateway.fullname" . }}
20
+ minReplicas : {{ .Values.autoscaling.minReplicas }}
21
+ maxReplicas : {{ .Values.autoscaling.maxReplicas }}
22
+ metrics :
23
+ {{- with .Values.autoscaling.targetMemoryUtilizationPercentage }}
24
+ - type : Resource
25
+ resource :
26
+ name : memory
27
+ target :
28
+ type : Utilization
29
+ averageUtilization : {{ . }}
30
+ {{- end }}
31
+ {{- with .Values.autoscaling.targetCPUUtilizationPercentage }}
32
+ - type : Resource
33
+ resource :
34
+ name : cpu
35
+ target :
36
+ type : Utilization
37
+ averageUtilization : {{ . }}
38
+ {{- end }}
39
+ {{- with .Values.autoscalingTemplate }}
40
+ {{- toYaml . | nindent 2 }}
41
+ {{- end }}
42
+ {{- with .Values.autoscaling.behavior }}
43
+ behavior :
44
+ {{- toYaml . | nindent 4 }}
45
+ {{- end }}
46
+ {{- end }}
You can’t perform that action at this time.
0 commit comments