fix: log warning if empty ingress class is monitored. Improve docs related to --ingress-class
This commit is contained in:
parent
4ad97afdb3
commit
903e511b9d
3 changed files with 6 additions and 2 deletions
|
@ -60,7 +60,7 @@ requests to the first port of this Service.`)
|
|||
ingressClass = flags.String("ingress-class", "",
|
||||
`Name of the ingress class this controller satisfies.
|
||||
The class of an Ingress object is set using the field IngressClassName in Kubernetes clusters version v1.18.0 or higher or the annotation "kubernetes.io/ingress.class" (deprecated).
|
||||
If this parameter is not set it will handle ingresses with either an empty or "nginx" class name.`)
|
||||
If this parameter is not set, or set to the default value of "nginx", it will handle ingresses with either an empty or "nginx" class name.`)
|
||||
|
||||
configMap = flags.String("configmap", "",
|
||||
`Name of the ConfigMap containing custom global configurations for the controller.`)
|
||||
|
@ -206,6 +206,8 @@ https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-g
|
|||
|
||||
if *ingressClass != class.DefaultClass {
|
||||
klog.Warningf("Only Ingresses with class %q will be processed by this Ingress controller", *ingressClass)
|
||||
} else {
|
||||
klog.Warning("Ingresses with an empty class will also be processed by this Ingress controller", *ingressClass)
|
||||
}
|
||||
|
||||
class.IngressClass = *ingressClass
|
||||
|
|
|
@ -25,7 +25,7 @@ They are set in the container spec of the `nginx-ingress-controller` Deployment
|
|||
| `--healthz-port` | Port to use for the healthz endpoint. (default 10254) |
|
||||
| `--http-port` | Port to use for servicing HTTP traffic. (default 80) |
|
||||
| `--https-port` | Port to use for servicing HTTPS traffic. (default 443) |
|
||||
| `--ingress-class` | Name of the ingress class this controller satisfies. The class of an Ingress object is set using the field IngressClassName in Kubernetes clusters version v1.18.0 or higher or the annotation "kubernetes.io/ingress.class" (deprecated). If this parameter is not set it will handle ingresses with either an empty or "nginx" class name. |
|
||||
| `--ingress-class` | Name of the ingress class this controller satisfies. The class of an Ingress object is set using the field IngressClassName in Kubernetes clusters version v1.18.0 or higher or the annotation "kubernetes.io/ingress.class" (deprecated). If this parameter is not set, or set to the default value of "nginx", it will handle ingresses with either an empty or "nginx" class name. |
|
||||
| `--kubeconfig` | Path to a kubeconfig file containing authorization and API server information. |
|
||||
| `--log_backtrace_at` | when logging hits line file:N, emit a stack trace (default :0) |
|
||||
| `--log_dir` | If non-empty, write log files in this directory |
|
||||
|
|
|
@ -54,3 +54,5 @@ spec:
|
|||
|
||||
When running multiple ingress-nginx controllers, it will only process an unset class annotation if one of the controllers uses the default
|
||||
`--ingress-class` value (see `IsValid` method in `internal/ingress/annotations/class/main.go`), otherwise the class annotation become required.
|
||||
|
||||
If `--ingress-class` is set to the default value of `nginx`, the controller will monitor Ingresses with no class annotation *and* Ingresses with annotation class set to `nginx`. Use a non-default value for `--ingress-class`, to ensure that the controller only satisfied the specific class of Ingresses.
|
||||
|
|
Loading…
Reference in a new issue