From 95fc78d89a92379b0a4178452aa2d60e393616cc Mon Sep 17 00:00:00 2001 From: Saed SayedAhmed Date: Wed, 20 Sep 2023 07:36:35 -0400 Subject: [PATCH 1/2] 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`. --- charts/nginx-ingress/templates/controller-hpa.yaml | 4 ++++ charts/nginx-ingress/values.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/charts/nginx-ingress/templates/controller-hpa.yaml b/charts/nginx-ingress/templates/controller-hpa.yaml index b8691648e9..971aca90d3 100644 --- a/charts/nginx-ingress/templates/controller-hpa.yaml +++ b/charts/nginx-ingress/templates/controller-hpa.yaml @@ -17,6 +17,10 @@ spec: name: {{ include "nginx-ingress.controller.fullname" . }} minReplicas: {{ .Values.controller.autoscaling.minReplicas }} maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }} +{{- if .Values.controller.autoscaling.behavior }} + behavior: +{{ toYaml .Values.controller.autoscaling.behavior | indent 4 }} +{{- end }} metrics: {{- if .Values.controller.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource diff --git a/charts/nginx-ingress/values.yaml b/charts/nginx-ingress/values.yaml index 13ed1e857c..9dd9a9a021 100644 --- a/charts/nginx-ingress/values.yaml +++ b/charts/nginx-ingress/values.yaml @@ -153,6 +153,8 @@ controller: targetCPUUtilizationPercentage: 50 ## The target memory utilization percentage. targetMemoryUtilizationPercentage: 50 + ## Custom behavior policies + behavior: {} ## The resources of the Ingress Controller pods. resources: From b1850e5d337217917174b4a26e918bc0ac685707 Mon Sep 17 00:00:00 2001 From: Saed SayedAhmed Date: Tue, 3 Oct 2023 12:54:16 -0400 Subject: [PATCH 2/2] update README --- charts/nginx-ingress/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/nginx-ingress/README.md b/charts/nginx-ingress/README.md index 8e1371e0ce..69f484bd85 100644 --- a/charts/nginx-ingress/README.md +++ b/charts/nginx-ingress/README.md @@ -313,6 +313,7 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont |`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 | |`controller.autoscaling.enabled` | Enables HorizontalPodAutoscaling. | false | |`controller.autoscaling.annotations` | The annotations of the Ingress Controller HorizontalPodAutoscaler. | {} | +|`controller.autoscaling.behavior` | Behavior configuration for the HPA. | {} | |`controller.autoscaling.minReplicas` | Minimum number of replicas for the HPA. | 1 | |`controller.autoscaling.maxReplicas` | Maximum number of replicas for the HPA. | 3 | |`controller.autoscaling.targetCPUUtilizationPercentage` | The target CPU utilization percentage. | 50 |