Skip to content
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/ingress-nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ metadata:
| controller.readinessProbe.timeoutSeconds | int | `1` | |
| controller.replicaCount | int | `1` | |
| controller.reportNodeInternalIp | bool | `false` | Bare-metal considerations via the host network https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#via-the-host-network Ingress status was blank because there is no Service exposing the Ingress-Nginx Controller in a configuration using the host network, the default --publish-service flag used in standard cloud setups does not apply |
| controller.resizePolicy | list | `[]` | Resize policy for controller containers. Ref: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources |
| controller.resources.requests.cpu | string | `"100m"` | |
| controller.resources.requests.memory | string | `"90Mi"` | |
| controller.runtimeClassName | string | `""` | Instruct the kubelet to use the named RuntimeClass to run the pod |
Expand Down
5 changes: 5 additions & 0 deletions charts/ingress-nginx/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ spec:
{{- if .Values.controller.resources }}
resources: {{ toYaml .Values.controller.resources | nindent 12 }}
{{- end }}
{{- if semverCompare ">=1.33.0-0" .Capabilities.KubeVersion.Version }}
{{- if .Values.controller.resizePolicy }}
resizePolicy: {{ toYaml .Values.controller.resizePolicy | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.controller.extraContainers }}
{{- toYaml .Values.controller.extraContainers | nindent 8 }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/ingress-nginx/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ spec:
{{- if .Values.controller.resources }}
resources: {{ toYaml .Values.controller.resources | nindent 12 }}
{{- end }}
{{- if semverCompare ">=1.33.0-0" .Capabilities.KubeVersion.Version }}
{{- if .Values.controller.resizePolicy }}
resizePolicy: {{ toYaml .Values.controller.resizePolicy | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.controller.extraContainers }}
{{- toYaml .Values.controller.extraContainers | nindent 8 }}
{{- end }}
Expand Down
20 changes: 20 additions & 0 deletions charts/ingress-nginx/tests/controller-daemonset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,23 @@ tests:
- equal:
path: spec.template.spec.runtimeClassName
value: myClass

- it: should create a DaemonSet with resize policy if `controller.resizePolicy` is set
capabilities:
majorVersion: 1
minorVersion: 33
set:
controller.kind: DaemonSet
controller.resizePolicy:
- resourceName: cpu
restartPolicy: NotRequired
- resourceName: memory
restartPolicy: RestartContainer
asserts:
- equal:
path: spec.template.spec.containers[0].resizePolicy
value:
- resourceName: cpu
restartPolicy: NotRequired
- resourceName: memory
restartPolicy: RestartContainer
19 changes: 19 additions & 0 deletions charts/ingress-nginx/tests/controller-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,22 @@ tests:
- equal:
path: spec.template.spec.runtimeClassName
value: myClass

- it: should create a Deployment with resize policy if `controller.resizePolicy` is set
capabilities:
majorVersion: 1
minorVersion: 33
set:
controller.resizePolicy:
- resourceName: cpu
restartPolicy: NotRequired
- resourceName: memory
restartPolicy: RestartContainer
asserts:
- equal:
path: spec.template.spec.containers[0].resizePolicy
value:
- resourceName: cpu
restartPolicy: NotRequired
- resourceName: memory
restartPolicy: RestartContainer
7 changes: 7 additions & 0 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,13 @@ controller:
requests:
cpu: 100m
memory: 90Mi
# -- Resize policy for controller containers.
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources
resizePolicy: []
# - resourceName: cpu
# restartPolicy: NotRequired
# - resourceName: memory
# restartPolicy: RestartContainer
# Mutually exclusive with keda autoscaling
autoscaling:
enabled: false
Expand Down