Skip to content

Commit 15a7ba7

Browse files
committed
Add helm config and docs
1 parent e4cfa01 commit 15a7ba7

File tree

8 files changed

+36
-13
lines changed

8 files changed

+36
-13
lines changed

cmd/nginx-ingress/flags.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ var (
2828
The Ingress Controller does not start NGINX and does not write any generated NGINX configuration files to disk`)
2929

3030
watchNamespace = flag.String("watch-namespace", api_v1.NamespaceAll,
31-
`Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces`)
31+
`Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces. Mutually exclusive with "watch-namespace-label".`)
3232

3333
watchNamespaces []string
3434

3535
watchSecretNamespace = flag.String("watch-secret-namespace", "",
36-
`Comma separated list of namespaces the Ingress Controller should watch for secrets. If this arg is not configured, the Ingress Controller watches the same namespaces for all resources. See "watch-namespace". `)
36+
`Comma separated list of namespaces the Ingress Controller should watch for secrets. If this arg is not configured, the Ingress Controller watches the same namespaces for all resources. See "watch-namespace" and "watch-namespace-label". `)
3737

3838
watchSecretNamespaces []string
3939

4040
watchNamespaceLabel = flag.String("watch-namespace-label", "",
41-
`Configures the Ingress Controller to watch only those namespaces with label foo=bar. By default the Ingress Controller watches all namespaces. `)
41+
`Configures the Ingress Controller to watch only those namespaces with label foo=bar. By default the Ingress Controller watches all namespaces. Mutually exclusive with "watch-namespace". `)
4242

4343
nginxConfigMaps = flag.String("nginx-configmaps", "",
4444
`A ConfigMap resource for customizing NGINX configuration. If a ConfigMap is set,

cmd/nginx-ingress/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func checkNamespaces(kubeClient kubernetes.Interface) {
248248
var newWatchNamespaces []string
249249
nsList, err := kubeClient.CoreV1().Namespaces().List(context.TODO(), meta_v1.ListOptions{LabelSelector: *watchNamespaceLabel})
250250
if err != nil {
251-
glog.Warningf("Error when getting Namespaces with the label selector %v: %v", watchNamespaceLabel, err)
251+
glog.Errorf("error when getting Namespaces with the label selector %v: %v", watchNamespaceLabel, err)
252252
}
253253
for _, ns := range nsList.Items {
254254
newWatchNamespaces = append(newWatchNamespaces, ns.Name)

deployments/helm-chart/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ Parameter | Description | Default
186186
`controller.replicaCount` | The number of replicas of the Ingress Controller deployment. | 1
187187
`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
188188
`controller.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass`. | false
189-
`controller.watchNamespace` | Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces. 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"`. | ""
190-
`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 `watch-namespace`. 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"`. | ""
189+
`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"`. | ""
190+
`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`. | ""
191+
`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"`. | ""
191192
`controller.enableCustomResources` | Enable the custom resources. | true
192193
`controller.enablePreviewPolicies` | Enable preview policies. This parameter is deprecated. To enable OIDC Policies please use `controller.enableOIDC` instead. | false
193194
`controller.enableOIDC` | Enable OIDC policies. | false

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ spec:
164164
{{- if .Values.controller.watchNamespace }}
165165
- -watch-namespace={{ .Values.controller.watchNamespace }}
166166
{{- end }}
167+
{{- if .Values.controller.watchNamespaceLabel }}
168+
- -watch-namespace-label={{ .Values.controller.watchNamespaceLabel }}
169+
{{- end }}
167170
{{- if .Values.controller.watchSecretNamespace }}
168171
- -watch-secret-namespace={{ .Values.controller.watchSecretNamespace }}
169172
{{- end }}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ spec:
167167
{{- if .Values.controller.watchNamespace }}
168168
- -watch-namespace={{ .Values.controller.watchNamespace }}
169169
{{- end }}
170+
{{- if .Values.controller.watchNamespaceLabel }}
171+
- -watch-namespace-label={{ .Values.controller.watchNamespaceLabel }}
172+
{{- end }}
170173
{{- if .Values.controller.watchSecretNamespace }}
171174
- -watch-secret-namespace={{ .Values.controller.watchSecretNamespace }}
172175
{{- end }}

deployments/helm-chart/values.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ controller:
1010
annotations: {}
1111

1212
## Deploys the Ingress Controller for NGINX Plus.
13-
nginxplus: false
13+
nginxplus: true
1414

1515
# Timeout in milliseconds which the Ingress Controller will wait for a successful NGINX reload after a change or at the initial start.
1616
nginxReloadTimeout: 60000
@@ -52,10 +52,10 @@ controller:
5252

5353
image:
5454
## The image repository of the Ingress Controller.
55-
repository: nginx/nginx-ingress
55+
repository: gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress
5656

5757
## The tag of the Ingress Controller image.
58-
tag: "2.4.1"
58+
tag: "2.4.1-labels"
5959

6060
## The digest of the Ingress Controller image.
6161
## If digest is specified it has precedence over tag and will be used instead
@@ -198,9 +198,12 @@ controller:
198198
## New Ingresses without an ingressClassName field specified will be assigned the class specified in `controller.ingressClass`.
199199
setAsDefaultIngress: false
200200

201-
## Comma separated list of namespaces to watch for Ingress resources. By default the Ingress Controller watches all namespaces.
201+
## Comma separated list of namespaces to watch for Ingress resources. By default the Ingress Controller watches all namespaces. Mutually exclusive with "controller.watchNamespaceLabel".
202202
watchNamespace: ""
203203

204+
## 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".
205+
watchNamespaceLabel: ""
206+
204207
## Comma separated list of namespaces to watch for Secret resources. By default the Ingress Controller watches all namespaces.
205208
watchSecretNamespace: ""
206209

docs/content/configuration/global-configuration/command-line-arguments.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,19 @@ A comma-separated list of pattern=N settings for file-filtered logging.
302302

303303
### -watch-namespace `<string>`
304304

305-
Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces.
305+
Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces. Mutually exclusive with "watch-namespace-label".
306+
&nbsp;
307+
<a name="cmdoption-watch-namespace-label"></a>
308+
309+
### -watch-namespace-label `<string>`
310+
311+
Configures the Ingress Controller to watch only those namespaces with label foo=bar. By default the Ingress Controller watches all namespaces. Mutually exclusive with "watch-namespace".
312+
&nbsp;
313+
<a name="cmdoption-watch-secret-namespace"></a>
314+
315+
### -watch-secret-namespace `<string>`
316+
317+
Comma separated list of namespaces the Ingress Controller should watch for secrets. If this arg is not configured, the Ingress Controller watches the same namespaces for all resources. See "watch-namespace" and "watch-namespace-label".
306318
&nbsp;
307319
<a name="cmdoption-enable-prometheus-metrics"></a>
308320

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ The following tables lists the configurable parameters of the NGINX Ingress Cont
185185
|``controller.replicaCount`` | The number of replicas of the Ingress Controller deployment. | 1 |
186186
|``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 |
187187
|``controller.setAsDefaultIngress`` | New Ingresses without an ingressClassName field specified will be assigned the class specified in `controller.ingressClass`. | false |
188-
|``controller.watchNamespace`` | Comma separated list of namespaces the Ingress Controller should watch for resources. By default the Ingress Controller watches all namespaces. 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"``. | "" |
189-
|``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 `watch-namespace`. 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"``. | "" |
188+
|``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"``. | "" |
189+
|``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`. | "" |
190+
|``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"``. | "" |
190191
|``controller.enableCustomResources`` | Enable the custom resources. | true |
191192
|``controller.enablePreviewPolicies`` | Enable preview policies. This parameter is deprecated. To enable OIDC Policies please use ``controller.enableOIDC`` instead. | false |
192193
|``controller.enableOIDC`` | Enable OIDC policies. | false |

0 commit comments

Comments
 (0)