Skip to content

Commit

Permalink
[Helm] Make HPA behavior configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
amirschw committed Jun 3, 2021
1 parent 9e89951 commit d845f76
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions charts/ingress-nginx/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

This file documents all notable changes to [ingress-nginx](https://github.com/kubernetes/ingress-nginx) Helm Chart. The release numbering uses [semantic versioning](http://semver.org).

### 3.33.0

- [XXXX] https://github.com/kubernetes/ingress-nginx/pull/XXXX Make HPA behavior configurable

### 3.32.0

- [7117] https://github.com/kubernetes/ingress-nginx/pull/7117 Add annotations for HPA
Expand Down
4 changes: 2 additions & 2 deletions charts/ingress-nginx/Chart.yaml
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: ingress-nginx
# When the version is modified, make sure the artifacthub.io/changes list is updated
# Also update CHANGELOG.md
version: 3.32.0
version: 3.33.0
appVersion: 0.46.0
home: https://github.com/kubernetes/ingress-nginx
description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
Expand All @@ -21,4 +21,4 @@ annotations:
# List of changes for the release in artifacthub.io
# https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx?modal=changelog
artifacthub.io/changes: |
- Removes the possibility of using localhost in ExternalNames as endpoints
- Make HPA behavior configurable
12 changes: 8 additions & 4 deletions charts/ingress-nginx/templates/controller-hpa.yaml
Expand Up @@ -21,9 +21,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 @@ -37,7 +37,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 @@ -321,6 +321,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 d845f76

Please sign in to comment.