Skip to content

Commit e390768

Browse files
authored
Add HPA Custom Behavior (#4391)
* Allow for HorizontalPodAutoscaler custom `behavior` - Defines a `controller.autoscaling.behavior` object and defaults it to an empty object `{}`. - References the object in the `templates/controller-hpa.yaml`. * update README
1 parent 4fc31a1 commit e390768

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

charts/nginx-ingress/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
441441
|`controller.minReadySeconds` | Specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. [docs](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#min-ready-seconds) | 0 |
442442
|`controller.autoscaling.enabled` | Enables HorizontalPodAutoscaling. | false |
443443
|`controller.autoscaling.annotations` | The annotations of the Ingress Controller HorizontalPodAutoscaler. | {} |
444+
|`controller.autoscaling.behavior` | Behavior configuration for the HPA. | {} |
444445
|`controller.autoscaling.minReplicas` | Minimum number of replicas for the HPA. | 1 |
445446
|`controller.autoscaling.maxReplicas` | Maximum number of replicas for the HPA. | 3 |
446447
|`controller.autoscaling.targetCPUUtilizationPercentage` | The target CPU utilization percentage. | 50 |

charts/nginx-ingress/templates/controller-hpa.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ spec:
1717
name: {{ include "nginx-ingress.controller.fullname" . }}
1818
minReplicas: {{ .Values.controller.autoscaling.minReplicas }}
1919
maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }}
20+
{{- if .Values.controller.autoscaling.behavior }}
21+
behavior:
22+
{{ toYaml .Values.controller.autoscaling.behavior | indent 4 }}
23+
{{- end }}
2024
metrics:
2125
{{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }}
2226
- type: Resource

charts/nginx-ingress/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ controller:
153153
targetCPUUtilizationPercentage: 50
154154
## The target memory utilization percentage.
155155
targetMemoryUtilizationPercentage: 50
156+
## Custom behavior policies
157+
behavior: {}
156158

157159
## The resources of the Ingress Controller pods.
158160
resources:

0 commit comments

Comments
 (0)