Skip to content

Add HPA Custom Behavior #4391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/nginx-ingress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,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 |
Expand Down
4 changes: 4 additions & 0 deletions charts/nginx-ingress/templates/controller-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions charts/nginx-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down