8000 Allow installing IC without creating a new ingress class (#4333) · nginx/kubernetes-ingress@1306b31 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1306b31

Browse files
authored
Allow installing IC without creating a new ingress class (#4333)
* Allow installing IC without creating a new ingress class Signed-off-by: Haywood Shannon <5781935+haywoodsh@users.noreply.github.com>
1 parent 724fd83 commit 1306b31

File tree

7 files changed

+54
-29
lines changed

7 files changed

+54
-29
lines changed

deployments/helm-chart/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
243243
|`controller.extraContainers` | Extra (eg. sidecar) containers for the Ingress Controller pods. | [] |
244244
|`controller.resources` | The resources of the Ingress Controller pods. | requests: cpu=100m,memory=128Mi |
245245
|`controller.replicaCount` | The number of replicas of the Ingress Controller deployment. | 1 |
246-
|`controller.ingressClass` | A class of the Ingress Controller. An IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress Controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of kubernetes. | nginx |
247-
|`controller.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass`. | false |
246+
|`controller.ingressClass.name` | A class of the Ingress Controller. An IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress Controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of Kubernetes. | nginx |
247+
|`controller.ingressClass.create` | Creates a new IngressClass object with the name `controller.ingressClass.name`. Set to `false` to use an existing ingressClass created using `kubectl` with the same name. If you use `helm upgrade`, do not change the values from the previous release as helm will delete IngressClass objects managed by helm. If you are upgrading from a release earlier than 3.3.0, do not set the value to false. | true |
248+
|`controller.ingressClass.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass.name`. Requires `controller.ingressClass.create`. | false |
248249
|`controller.watchNamespace` | Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces. Mutually exclusive with `controller.watchNamespaceLabel`. Please note that if configuring multiple namespaces using the Helm cli `--set` option, the string needs to wrapped in double quotes and the commas escaped using a backslash - e.g. `--set controller.watchNamespace="default\,nginx-ingress"`. | "" |
249250
|`controller.watchNamespaceLabel` | Configures the Ingress Controller to watch only those namespaces with label foo=bar. By default the Ingress Controller watches all namespaces. Mutually exclusive with `controller.watchNamespace`. | "" |
250251
|`controller.watchSecretNamespace` | Comma separated list of namespaces the Ingress Controller should watch for resources of type Secret. If this arg is not configured, the Ingress Controller watches the same namespaces for all resources. See `controller.watchNamespace` and `controller.watchNamespaceLabel`. Please note that if configuring multiple namespaces using the Helm cli `--set` option, the string needs to wrapped in double quotes and the commas escaped using a backslash - e.g. `--set controller.watchSecretNamespace="default\,nginx-ingress"`. | "" |

deployments/helm-chart/templates/controller-daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ spec:
180180
{{ else if and (.Values.controller.defaultTLS.cert) (.Values.controller.defaultTLS.key) }}
181181
- -default-server-tls-secret=$(POD_NAMESPACE)/{{ include "nginx-ingress.defaultTLSName" . }}
182182
{{- end }}
183-
- -ingress-class={{ .Values.controller.ingressClass }}
183+
- -ingress-class={{ .Values.controller.ingressClass.name }}
184184
{{- if .Values.controller.watchNamespace }}
185185
- -watch-namespace={{ .Values.controller.watchNamespace }}
186186
{{- end }}

deployments/helm-chart/templates/controller-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ spec:
187187
{{ else if and (.Values.controller.defaultTLS.cert) (.Values.controller.defaultTLS.key) }}
188188
- -default-server-tls-secret=$(POD_NAMESPACE)/{{ include "nginx-ingress.defaultTLSName" . }}
189189
{{- end }}
190-
- -ingress-class={{ .Values.controller.ingressClass }}
190+
- -ingress-class={{ .Values.controller.ingressClass.name }}
191191
{{- if .Values.controller.watchNamespace }}
192192
- -watch-namespace={{ .Values.controller.watchNamespace }}
193193
{{- end }}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
{{ if .Values.controller.ingressClass.create }}
12
apiVersion: networking.k8s.io/v1
23
kind: IngressClass
34
metadata:
4-
name: {{ .Values.controller.ingressClass }}
5+
name: {{ .Values.controller.ingressClass.name }}
56
labels:
67
{{- include "nginx-ingress.labels" . | nindent 4 }}
7-
{{- if .Values.controller.setAsDefaultIngress }}
8+
{{- if .Values.controller.ingressClass.setAsDefaultIngress }}
89
annotations:
910
ingressclass.kubernetes.io/is-default-class: "true"
1011
{{- end }}
1112
spec:
1213
controller: nginx.org/ingress-controller
14+
{{ end }}

deployments/helm-chart/values.schema.json

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -577,20 +577,36 @@
577577
]
578578
},
579579
"ingressClass": {
580-
"type": "string",
581-
"default": "",
580+
"type": "object",
581+
"default": {},
582582
"title": "The ingressClass",
583-
"examples": [
584-
"nginx"
585-
]
586-
},
587-
"setAsDefaultIngress": {
588-
"type": "boolean",
589-
"default": false,
590-
"title": "The setAsDefaultIngress",
591-
"examples": [
592-
false
593-
]
583+
"required": [],
584+
"properties": {
585+
"create": {
586+
"type": "boolean",
587+
"default": true,
588+
"title": "The create",
589+
"examples": [
590+
true
591+
]
592+
},
593+
"name": {
594+
"type": "string",
595+
"default": "",
596+
"title": "The ingressClass name",
597+
"examples": [
598+
"nginx"
599< DC9C code class="diff-text syntax-highlighted-line addition">+
]
600+
},
601+
"setAsDefaultIngress": {
602+
"type": "boolean",
603+
"default": false,
604+
"title": "The setAsDefaultIngress",
605+
"examples": [
606+
false
607+
]
608+
}
609+
}
594610
},
595611
"watchNamespace": {
596612
"type": "string",

deployments/helm-chart/values.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,17 +221,22 @@ controller:
221221
## The number of replicas of the Ingress Controller deployment.
222222
replicaCount: 1
223223

224-
## A class of the Ingress Controller.
224+
# Configures the ingress class the Ingress Controller uses.
225+
ingressClass:
226+
## A class of the Ingress Controller.
225227

226-
## IngressClass resource with the name equal to the class must be deployed. Otherwise,
227-
## the Ingress Controller will fail to start.
228-
## The Ingress Controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class.
228+
## IngressClass resource with the name equal to the class must be deployed. Otherwise,
229+
## the Ingress Controller will fail to start.
230+
## The Ingress Controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class.
229231

230-
## The Ingress Controller processes all the resources that do not have the "ingressClassName" field for all versions of kubernetes.
231-
ingressClass: nginx
232+
## The Ingress Controller processes all the resources that do not have the "ingressClassName" field for all versions of kubernetes.
233+
name: nginx
232234

233-
## New Ingresses without an ingressClassName field specified will be assigned the class specified in `controller.ingressClass`.
234-
setAsDefaultIngress: false
235+
## Creates a new IngressClass object with the name "controller.ingressClass.name". Set to false to use an existing IngressClass with the same name. If you use helm upgrade, do not change the values from the previous release as helm will delete IngressClass objects managed by helm. If you are upgrading from a release earlier than 3.3.0, do not set the value to false.
236+
create: true
237+
238+
## New Ingresses without an ingressClassName field specified will be assigned the class specified in `controller.ingressClass`. Requires "controller.ingressClass.create".
239+
setAsDefaultIngress: false
235240

236241
## Comma separated list of namespaces to watch for Ingress resources. By default the Ingress Controller watches all namespaces. Mutually exclusive with "controller.watchNamespaceLabel".
237242
watchNamespace: ""

docs/content/installation/installation-with-helm.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,9 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
327327
|`controller.extraContainers` | Extra (eg. sidecar) containers for the Ingress Controller pods. | [] |
328328
|`controller.resources` | The resources of the Ingress Controller pods. | requests: cpu=100m,memory=128Mi |
329329
|`controller.replicaCount` | The number of replicas of the Ingress Controller deployment. | 1 |
330-
|`controller.ingressClass` | A class of the Ingress Controller. An IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress Controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of Kubernetes. | nginx |
331-
|`controller.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass`. | false |
330+
|`controller.ingressClass.name` | A class of the Ingress Controller. An IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress Controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of Kubernetes. | nginx |
331+
|`controller.ingressClass.create` | Creates a new IngressClass object with the name `controller.ingressClass.name`. Set to `false` to use an existing IngressClass with the same name. If you use helm upgrade, do not change the values from the previous release as helm will delete IngressClass objects managed by helm. If you are upgrading from a release earlier than 3.3.0, do not set the value to false. | true |
332+
|`controller.ingressClass.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass.name`. Requires `controller.ingressClass.create`. | false |
332333
|`controller.watchNamespace` | Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces. Mutually exclusive with `controller.watchNamespaceLabel`. Please note that if configuring multiple namespaces using the Helm cli `--set` option, the string needs to wrapped in double quotes and the commas escaped using a backslash - e.g. `--set controller.watchNamespace="default\,nginx-ingress"`. | "" |
333334
|`controller.watchNamespaceLabel` | Configures the Ingress Controller to watch only those namespaces with label foo=bar. By default the Ingress Controller watches all namespaces. Mutually exclusive with `controller.watchNamespace`. | "" |
334335
|`controller.watchSecretNamespace` | Comma separated list of namespaces the Ingress Controller should watch for resources of type Secret. If this arg is not configured, the Ingress Controller watches the same namespaces for all resources. See `controller.watchNamespace` and `controller.watchNamespaceLabel`. Please note that if configuring multiple namespaces using the Helm cli `--set` option, the string needs to wrapped in double quotes and the commas escaped using a backslash - e.g. `--set controller.watchSecretNamespace="default\,nginx-ingress"`. | "" |

0 commit comments

Comments
 (0)
0