Skip to content

Commit 886430d

Browse files
committed
add: nginxGateway HPA
1 parent 7c87b0b commit 886430d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

charts/nginx-gateway-fabric/templates/hpa.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }}
33
kind: HorizontalPodAutoscaler
44
metadata:
5-
{{- with .Values.autoscaling.annotations }}
5+
{{- with .Values.nginxGateway.autoscaling.annotations }}
66
annotations: {{ toYaml . | nindent 4 }}
77
{{- end }}
88
labels:
@@ -17,18 +17,18 @@ spec:
1717
apiVersion: apps/v1
1818
kind: Deployment
1919
name: {{ include "nginx-gateway.fullname" . }}
20-
minReplicas: {{ .Values.autoscaling.minReplicas }}
21-
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
20+
minReplicas: {{ .Values.nginxGateway.autoscaling.minReplicas }}
21+
maxReplicas: {{ .Values.nginxGateway.autoscaling.maxReplicas }}
2222
metrics:
23-
{{- with .Values.autoscaling.targetMemoryUtilizationPercentage }}
23+
{{- with .Values.nginxGateway.autoscaling.targetMemoryUtilizationPercentage }}
2424
- type: Resource
2525
resource:
2626
name: memory
2727
target:
2828
type: Utilization
2929
averageUtilization: {{ . }}
3030
{{- end }}
31-
{{- with .Values.autoscaling.targetCPUUtilizationPercentage }}
31+
{{- with .Values.nginxGateway.autoscaling.targetCPUUtilizationPercentage }}
3232
- type: Resource
3333
resource:
3434
name: cpu
@@ -39,7 +39,7 @@ spec:
3939
{{- with .Values.autoscalingTemplate }}
4040
{{- toYaml . | nindent 2 }}
4141
{{- end }}
42-
{{- with .Values.autoscaling.behavior }}
42+
{{- with .Values.nginxGateway.autoscaling.behavior }}
4343
behavior:
4444
{{- toYaml . | nindent 4 }}
4545
{{- end }}

charts/nginx-gateway-fabric/values.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ nginxGateway:
157157
topologySpreadConstraints: []
158158

159159
autoscaling:
160+
# Enable or disable Horizontal Pod Autoscaler
160161
enabled: false
161162
annotations: {}
162163
minReplicas: 1
@@ -252,8 +253,6 @@ nginx:
252253
# plane will copy these secrets into any namespace where NGINX is deployed.
253254
imagePullSecrets: []
254255

255-
resources: {}
256-
257256
# Configuration for NGINX Plus usage reporting.
258257
usage:
259258
# -- The name of the Secret containing the JWT for NGINX Plus usage reporting. Must exist in the same namespace

0 commit comments

Comments
 (0)