[ingress] make nginx resources configurable (#1416)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- New Features
- Added per-replica CPU and memory configuration for the ingress
controller.
- Introduced resource presets (nano, micro, small, medium, large,
xlarge, 2xlarge) with a default of micro.
- Documentation
- Updated parameters guide to document new resource settings and
presets.
- Chores
  - Bumped ingress chart version to 1.9.0.
- Updated version mapping to include the new chart version and pin the
previous one.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Andrei Kvapil
2025-09-15 18:42:17 +02:00
committed by GitHub
6 changed files with 76 additions and 12 deletions

View File

@@ -3,4 +3,4 @@ name: ingress
description: NGINX Ingress Controller
icon: /logos/ingress-nginx.svg
type: application
version: 1.8.0
version: 1.9.0

View File

@@ -4,9 +4,13 @@
### Common parameters
| Name | Description | Type | Value |
| ---------------- | ----------------------------------------------------------------- | ----------- | ------- |
| `replicas` | Number of ingress-nginx replicas | `int` | `2` |
| `whitelist` | List of client networks | `[]*string` | `[]` |
| `clouflareProxy` | Restoring original visitor IPs when Cloudflare proxied is enabled | `bool` | `false` |
| Name | Description | Type | Value |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------- |
| `replicas` | Number of ingress-nginx replicas | `int` | `2` |
| `whitelist` | List of client networks | `[]*string` | `[]` |
| `cloudflareProxy` | Restoring original visitor IPs when Cloudflare proxied is enabled | `bool` | `false` |
| `resources` | Explicit CPU and memory configuration for each ingress-nginx replica. When left empty, the preset defined in `resourcesPreset` is applied. | `*object` | `{}` |
| `resources.cpu` | CPU available to each replica | `*quantity` | `null` |
| `resources.memory` | Memory (RAM) available to each replica | `*quantity` | `null` |
| `resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`. | `string` | `micro` |

View File

@@ -29,6 +29,7 @@ spec:
controller:
replicaCount: {{ .Values.replicas }}
ingressClass: {{ .Release.Namespace }}
resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.resourcesPreset .Values.resources $) | nindent 10 }}
ingressClassResource:
name: {{ .Release.Namespace }}
controllerValue: k8s.io/ingress-nginx-{{ .Release.Namespace }}
@@ -49,12 +50,12 @@ spec:
type: LoadBalancer
externalTrafficPolicy: Local
{{- end }}
{{- if or .Values.whitelist .Values.clouflareProxy }}
{{- if or .Values.whitelist .Values.cloudflareProxy }}
config:
{{- with .Values.whitelist }}
whitelist-source-range: "{{ join "," . }}"
{{- end }}
{{- if .Values.clouflareProxy }}
{{- if .Values.cloudflareProxy }}
set_real_ip_from: "{{ include "ingress.cloudflare-ips" . }}"
use-forwarded-headers: "true"
server-snippet: "real_ip_header CF-Connecting-IP;"

View File

@@ -2,7 +2,7 @@
"title": "Chart Values",
"type": "object",
"properties": {
"clouflareProxy": {
"cloudflareProxy": {
"description": "Restoring original visitor IPs when Cloudflare proxied is enabled",
"type": "boolean",
"default": false
@@ -12,6 +12,53 @@
"type": "integer",
"default": 2
},
"resources": {
"description": "Explicit CPU and memory configuration for each ingress-nginx replica. When left empty, the preset defined in `resourcesPreset` is applied.",
"type": "object",
"default": {},
"properties": {
"cpu": {
"description": "CPU available to each replica",
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-kubernetes-int-or-string": true
},
"memory": {
"description": "Memory (RAM) available to each replica",
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-kubernetes-int-or-string": true
}
}
},
"resourcesPreset": {
"description": "Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`.",
"type": "string",
"default": "micro",
"enum": [
"nano",
"micro",
"small",
"medium",
"large",
"xlarge",
"2xlarge"
]
},
"whitelist": {
"description": "List of client networks",
"type": "array",

View File

@@ -11,5 +11,16 @@ replicas: 2
## - "10.100.0.0/16"
whitelist: []
## @param clouflareProxy {bool} Restoring original visitor IPs when Cloudflare proxied is enabled
clouflareProxy: false
## @param cloudflareProxy {bool} Restoring original visitor IPs when Cloudflare proxied is enabled
cloudflareProxy: false
## @param resources {*resources} Explicit CPU and memory configuration for each ingress-nginx replica. When left empty, the preset defined in `resourcesPreset` is applied.
## @field resources.cpu {*quantity} CPU available to each replica
## @field resources.memory {*quantity} Memory (RAM) available to each replica
## Example:
## resources:
## cpu: 4000m
## memory: 4Gi
resources: {}
## @param resourcesPreset {string enum:"nano,micro,small,medium,large,xlarge,2xlarge"} Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`.
resourcesPreset: "micro"

View File

@@ -30,7 +30,8 @@ ingress 1.4.0 fd240701
ingress 1.5.0 93bdf411
ingress 1.6.0 632224a3
ingress 1.7.0 c02a3818
ingress 1.8.0 HEAD
ingress 1.8.0 8f1975d1
ingress 1.9.0 HEAD
monitoring 1.0.0 d7cfa53c
monitoring 1.1.0 25221fdc
monitoring 1.2.0 f81be075