Skip to content

Commit f358fd5

Browse files
authored
MAJOR: kubernetes-ingress: Support to specify HPA behavior (#274)
Signed-off-by: Philipp Hossner <[email protected]>
1 parent 4733b8f commit f358fd5

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

kubernetes-ingress/ci/deployment-hpa-values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ controller:
44
minReplicas: 1
55
maxReplicas: 5
66
targetCPUUtilizationPercentage: 80
7+
behavior:
8+
scaleUp:
9+
policies:
10+
- type: Percent
11+
value: 900
12+
periodSeconds: 60
13+
scaleDown:
14+
stabilizationWindowSeconds: 600
15+
policies:
16+
- type: Pods
17+
value: 1
18+
periodSeconds: 600
719

820
defaultBackend:
921
autoscaling:

kubernetes-ingress/templates/controller-hpa.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ spec:
4444
name: {{ include "kubernetes-ingress.fullname" . }}
4545
minReplicas: {{ .Values.controller.autoscaling.minReplicas }}
4646
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
47+
{{- if .Values.controller.autoscaling.behavior }}
48+
behavior: {{- toYaml .Values.controller.autoscaling.behavior | nindent 4 }}
49+
{{- end }}
4750
metrics:
4851
{{- if .Values.controller.autoscaling.targetCPUUtilizationPercentage }}
4952
- type: Resource

kubernetes-ingress/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ controller:
235235
annotations: {}
236236
# annotationKey: value
237237

238+
## Behavior
239+
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior
240+
# behavior:
241+
# scaleDown:
242+
# stabilizationWindowSeconds: 3600
243+
238244
## Custom metrics (example)
239245
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics
240246
# custom:

0 commit comments

Comments
 (0)