Skip to content

Commit

Permalink
Updated cli docs
Browse files Browse the repository at this point in the history
  • Loading branch information
soneillf5 committed Aug 16, 2021
1 parent 1cf423b commit f7cfafe
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 29 deletions.
8 changes: 1 addition & 7 deletions cmd/nginx-ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,9 @@ var (
ingressClass = flag.String("ingress-class", "nginx",
`A class of the Ingress controller.
For Kubernetes >= 1.18, a corresponding IngressClass resource with the name equal to the class must be deployed. Otherwise,
the Ingress Controller will fail to start.
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.
For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class -
i.e have the annotation "kubernetes.io/ingress.class" (for Ingress resources)
or field "ingressClassName" equal to the class.
Additionally, the Ingress Controller processes resources that do not have the class set.
The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of kubernetes.`)

defaultServerSecret = flag.String("default-server-tls-secret", "",
Expand Down
4 changes: 2 additions & 2 deletions deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ Parameter | Description | Default
`controller.volumeMounts` | The volumeMounts of the Ingress controller pods. | []
`controller.resources` | The resources of the Ingress controller pods. | {}
`controller.replicaCount` | The number of replicas of the Ingress controller deployment. | 1
`controller.ingressClass` | A class of the Ingress controller. For Kubernetes >= 1.18, a corresponding 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. For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class - i.e have the annotation "kubernetes.io/ingress.class" (for Ingress resources) or field "ingressClassName" equal to the class. Additionally, the Ingress Controller processes resources that do not have the class set. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of kubernetes. | nginx
`controller.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass`. Only for kubernetes versions >= 1.18. | false
`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
`controller.setAsDefaultIngress` | New Ingresses without an `"ingressClassName"` field specified will be assigned the class specified in `controller.ingressClass`. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.enableCustomResources` | Enable the custom resources. | true
`controller.enablePreviewPolicies` | Enable preview policies. | false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
Expand All @@ -9,4 +8,3 @@ metadata:
{{- end }}
spec:
controller: nginx.org/ingress-controller
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,9 @@ Below we describe the available command-line arguments:
A class of the Ingress controller.
For Kubernetes >= 1.18, a corresponding IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start.
A corresponding 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.
For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class - i.e have the annotation "kubernetes.io/ingress.class" (for Ingress resources) or field "ingressClassName" equal to the class.
Additionally, the Ingress Controller processes resources that do not have the class set, which can be disabled by setting the "-use-ingress-class-only" flag.
The Ingress Controller processes all the resources that do not have the "ingressClassName" field.
(default "nginx")
Expand Down Expand Up @@ -170,12 +167,6 @@ Below we describe the available command-line arguments:
- Default for NGINX is "nginx.transportserver.tmpl"
- Default for NGINX Plus is "nginx-plus.transportserver.tmpl".
-use-ingress-class-only
For kubernetes versions >= 1.18 this flag will be IGNORED.
Ignore Ingress resources without the "kubernetes.io/ingress.class" annotation.
-v <value>
Log level for V logs
Expand Down
3 changes: 1 addition & 2 deletions docs/content/installation/installation-with-helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ The following tables lists the configurable parameters of the NGINX Ingress cont
|``controller.volumeMounts`` | The volumeMounts of the Ingress controller pods. | [] |
|``controller.resources`` | The resources of the Ingress controller pods. | {} |
|``controller.replicaCount`` | The number of replicas of the Ingress controller deployment. | 1 |
|``controller.ingressClass`` | A class of the Ingress controller. For Kubernetes >= 1.18, a corresponding 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. For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class - i.e have the annotation ``"kubernetes.io/ingress.class"`` (for Ingress resources) or field ``"ingressClassName"`` (for VirtualServer/VirtualServerRoute/TransportServer resources) equal to the class. Additionally, the Ingress Controller processes resources that do not have the class set, which can be disabled by setting the ``controller.useIngressClassOnly`` parameter to ``true``. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the ``"ingressClassName"`` field for all versions of kubernetes. | nginx |
|``controller.useIngressClassOnly`` | Ignore Ingress resources without the ``"kubernetes.io/ingress.class"`` annotation. For kubernetes versions >= 1.18 this flag will be IGNORED. | false |
|``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 |
|``controller.setAsDefaultIngress`` | New Ingresses without an ingressClassName field specified will be assigned the class specified in `controller.ingressClass`. | false |
|``controller.watchNamespace`` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | "" |
|``controller.enableCustomResources`` | Enable the custom resources. | true |
Expand Down
2 changes: 1 addition & 1 deletion docs/content/installation/installation-with-manifests.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ In this section, we create resources common for most of the Ingress Controller i
$ kubectl apply -f common/nginx-config.yaml
```
1. Create an IngressClass resource (for Kubernetes >= 1.18):
1. Create an IngressClass resource:
```
$ kubectl apply -f common/ingress-class.yaml
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ This document explains the following topics:
## Ingress Class

The smooth coexistence of multiple Ingress Controllers in one cluster is provided by the Ingress class concept, which mandates the following:
* Every Ingress Controller must only handle Ingress resources for its particular class.
* For Kubernetes < 1.18, Ingress resources should be annotated with the `kubernetes.io/ingress.class` annotation set to the value, which corresponds to the class of the Ingress Controller the user wants to use.
* When using versions of Kubernetes >= 1.18, Ingress resources should have the `ingressClassName` field set to the value, which corresponds to the class of the Ingress Controller the user wants to use.
* Every Ingress Controller must only handle Ingress resources for its particular class.
* Ingress resources should have the `ingressClassName` field set to the value, which corresponds to the class of the Ingress Controller the user wants to use.
* VirtualServer, VirtualServerRoute, Policy and TransportServer resources should have the `ingressClassName` field set to the value, which corresponds to the class of the Ingress Controller the user wants to use.

### Configuring Ingress Class

The default Ingress class of NGINX Ingress Controller is `nginx`, which means that it only handles configuration resources with the `class` set to `nginx`. You can customize the class through the `-ingress-class` command-line argument.

**Notes**:
* For Kubernetes < 1.18, if the class is not set in an Ingress configuration resource, the Ingress Controller will handle the resource. This is controlled via the `-use-ingress-class-only` argument.
* For Kubernetes >= 1.18, if the class is not set in an Ingress resource, Kubernetes will set it to the class of the default Ingress Controller. To make the Ingress Controller the default one, the `ingressclass.kubernetes.io/is-default-class` must be set on the IngressClass resource. See Step 3 *Create an IngressClass resource* of the [Create Common Resources](/nginx-ingress-controller/installation/installation-with-manifests/#create-common-resources) section.
* If the class is not set in an Ingress resource, Kubernetes will set it to the class of the default Ingress Controller. To make the Ingress Controller the default one, the `ingressclass.kubernetes.io/is-default-class` must be set on the IngressClass resource. See Step 3 *Create an IngressClass resource* of the [Create Common Resources](/nginx-ingress-controller/installation/installation-with-manifests/#create-common-resources) section.
* For VirtualServer, VirtualServerRoute, Policy and TransportServer resources the Ingress Controller will always handle resources with an empty class.

## Running NGINX Ingress Controller and Another Ingress Controller
Expand Down

0 comments on commit f7cfafe

Please sign in to comment.