Skip to content

Commit

Permalink
[Helm] Make HPA behavior configurable (#7203)
Browse files Browse the repository at this point in the history
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
  • Loading branch information
amirschw committed Aug 22, 2021
1 parent 5e5faa2 commit 605c243
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
@@ -0,0 +1,14 @@
controller:
autoscaling:
enabled: true
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 1
periodSeconds: 180
admissionWebhooks:
enabled: false
service:
type: ClusterIP
12 changes: 8 additions & 4 deletions charts/ingress-nginx/templates/controller-hpa.yaml
Expand Up @@ -22,9 +22,9 @@ spec:
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
metrics:
{{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ . }}
Expand All @@ -38,7 +38,11 @@ spec:
averageUtilization: {{ . }}
{{- end }}
{{- with .Values.controller.autoscalingTemplate }}
{{- toYaml . | nindent 2 }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.controller.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions charts/ingress-nginx/values.yaml
Expand Up @@ -338,6 +338,19 @@ controller:
maxReplicas: 11
targetCPUUtilizationPercentage: 50
targetMemoryUtilizationPercentage: 50
behavior: {}
# scaleDown:
# stabilizationWindowSeconds: 300
# policies:
# - type: Pods
# value: 1
# periodSeconds: 180
# scaleUp:
# stabilizationWindowSeconds: 300
# policies:
# - type: Pods
# value: 2
# periodSeconds: 60

autoscalingTemplate: []
# Custom or additional autoscaling metrics
Expand Down

0 comments on commit 605c243

Please sign in to comment.