Skip to content

Commit

Permalink
Merge pull request kubernetes#6049 from toredash/fix/ingress-class-docs
Browse files Browse the repository at this point in the history
Improve docs and logging for --ingress-class usage
  • Loading branch information
k8s-ci-robot authored Aug 21, 2020
2 parents 7fe5ecc + 903e511 commit 726be88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/nginx/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.`)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/cli-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 2 additions & 0 deletions docs/user-guide/multiple-ingress.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 726be88

Please sign in to comment.