Skip to content

Commit

Permalink
Add Helm documention. Improve CLI flags
Browse files Browse the repository at this point in the history
Helm documentation for the following added:
* ingressClass
* useIngressClassOnly
* watchNamespace
* healthStatus

Formatting error fixed for controller.service.annotations default value

Update flags to have more standard format and more understandable
Dean-Coakley committed Jul 2, 2018
1 parent 6173d8d commit 1144d00
Showing 3 changed files with 50 additions and 43 deletions.
50 changes: 26 additions & 24 deletions docs/cli-arguments.md
Original file line number Diff line number Diff line change
@@ -3,43 +3,45 @@
```
Usage of ./nginx-ingress:
-alsologtostderr
log to standard error as well as files
log to standard error as well as files
-default-server-tls-secret string
Specifies a secret with a TLS certificate and key for SSL termination of the default server.
The value must follow the following format: <namespace>/<name>.
If not specified, the key and the cert from /etc/nginx/secrets/default is used.
A Secret with a TLS certificate and key for TLS termination of the default server. Format: <namespace>/<name>.
If not set, certificate and key in the file "/etc/nginx/secrets/default" are used. If a secret is set,
but the Ingress controller is not able to fetch it from Kubernetes API or a secret is not set and
the file "/etc/nginx/secrets/default" does not exist, the Ingress controller will fail to start
-health-status
If present, the default server listening on port 80 with the health check location "/nginx-health"
gets added to the main nginx configuration.
Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request.
Useful for external health-checking of the Ingress controller
-ingress-class string
Specifies a class of ingress. Only processes Ingresses with this value in annotations.
Can be used with --use-ingress-class-only. Default 'nginx' (default "nginx")
A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its class
- i.e. have the annotation "kubernetes.io/ingress.class" equal to the class. Additionally,
the Ingress controller processes Ingress resources that do not have that annotation,
which can be disabled by setting the "-use-ingress-class-only" flag (default "nginx")
-log_backtrace_at value
when logging hits line file:N, emit a stack trace
when logging hits line file:N, emit a stack trace
-log_dir string
If non-empty, write log files in this directory
If non-empty, write log files in this directory
-logtostderr
log to standard error instead of files
log to standard error instead of files
-nginx-configmaps string
Specifies a configmaps resource that can be used to customize NGINX configuration.
The value must follow the following format: <namespace>/<name>
A ConfigMap resource for customizing NGINX configuration. If a ConfigMap is set,
but the Ingress controller is not able to fetch it from Kubernetes API, the Ingress controller will fail to start.
Format: <namespace>/<name>
-nginx-plus
Enables support for NGINX Plus.
Enable support for NGINX Plus
-proxy string
If specified, the controller assumes a kubctl proxy server is running on the given url and creates a proxy client.
Regenerated NGINX configuration files are not written to the disk, instead they are printed to stdout.
Also NGINX is not getting invoked. This flag is for testing.
Use a proxy server to connect to Kubernetes API started by "kubectl proxy" command. For testing purposes only.
The Ingress controller does not start NGINX and does not write any generated NGINX configuration files to disk
-stderrthreshold value
logs at or above this threshold go to stderr
logs at or above this threshold go to stderr
-use-ingress-class-only
If true, ingress resource will handled by ingress controller with class which specifed
by value of ingress-class. Default false
Ignore Ingress resources without the "kubernetes.io/ingress.class" annotation
-v value
log level for V logs
log level for V logs
-version
Print the version and git-commit hash and exit.
Print the version and git-commit hash and exit
-vmodule value
comma-separated list of pattern=N settings for file-filtered logging
comma-separated list of pattern=N settings for file-filtered logging
-watch-namespace string
Namespace to watch for Ingress/Services/Endpoints. By default the controller watches acrosss all namespaces
Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces
```
6 changes: 5 additions & 1 deletion helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -75,8 +75,12 @@ Parameter | Description | Default
`controller.service.create` | Creates a service to expose the Ingress controller pods. | true
`controller.service.type` | The type of service to create for the Ingress controller. | LoadBalancer
`controller.service.externalTrafficPolicy` | The externalTrafficPolicy of the service. The value Local preserves the client source IP. | Local
`controller.service.annotations` | The annotations of the Ingress controller service. | {}
`controller.service.annotations` | The annotations of the Ingress controller service. | { }
`controller.serviceAccountName` | The serviceAccountName of the Ingress controller pods. Used for RBAC. | nginx-ingress
`controller.ingressClass` | A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its class - i.e. have the annotation `"kubernetes.io/ingress.class"` equal to the class. Additionally, the Ingress controller processes Ingress resources that do not have that annotation which can be disabled by setting the "-use-ingress-class-only" flag. | nginx
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
`rbac.create` | Configures RBAC. | true

Example:
37 changes: 19 additions & 18 deletions nginx-controller/main.go
Original file line number Diff line number Diff line change
@@ -28,38 +28,39 @@ var (
gitCommit string

healthStatus = flag.Bool("health-status", false,
`If present, the default server listening on port 80 with the health check
location "/nginx-health" gets added to the main nginx configuration.`)
`Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request.
Useful for external health-checking of the Ingress controller`)

proxyURL = flag.String("proxy", "",
`If specified, the controller assumes a kubctl proxy server is running on the
given url and creates a proxy client. Regenerated NGINX configuration files
are not written to the disk, instead they are printed to stdout. Also NGINX
is not getting invoked. This flag is for testing.`)
`Use a proxy server to connect to Kubernetes API started by "kubectl proxy" command. For testing purposes only.
The Ingress controller does not start NGINX and does not write any generated NGINX configuration files to disk`)

watchNamespace = flag.String("watch-namespace", api_v1.NamespaceAll,
`Namespace to watch for Ingress/Services/Endpoints. By default the controller
watches acrosss all namespaces`)
`Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces`)

nginxConfigMaps = flag.String("nginx-configmaps", "",
`Specifies a configmaps resource that can be used to customize NGINX
configuration. The value must follow the following format: <namespace>/<name>`)
`A ConfigMap resource for customizing NGINX configuration. If a ConfigMap is set,
but the Ingress controller is not able to fetch it from Kubernetes API, the Ingress controller will fail to start.
Format: <namespace>/<name>`)

nginxPlus = flag.Bool("nginx-plus", false,
`Enables support for NGINX Plus.`)
nginxPlus = flag.Bool("nginx-plus", false, "Enable support for NGINX Plus")

ingressClass = flag.String("ingress-class", "nginx",
`Specifies a class of ingress. Only processes Ingresses with this value in annotations. Can be used with --use-ingress-class-only. Default 'nginx'`)
`A class of the Ingress controller. The Ingress controller only processes Ingress resources that belong to its class
- i.e. have the annotation "kubernetes.io/ingress.class" equal to the class. Additionally,
the Ingress controller processes Ingress resources that do not have that annotation,
which can be disabled by setting the "-use-ingress-class-only" flag`)

useIngressClassOnly = flag.Bool("use-ingress-class-only", false,
`If true, ingress resource will handled by ingress controller with class which specifed by value of ingress-class. Default false`)
`Ignore Ingress resources without the "kubernetes.io/ingress.class" annotation`)

defaultServerSecret = flag.String("default-server-tls-secret", "",
`Specifies a secret with a TLS certificate and key for SSL termination of
the default server. The value must follow the following format: <namespace>/<name>.
If not specified, the key and the cert from /etc/nginx/secrets/default is used.`)
`A Secret with a TLS certificate and key for TLS termination of the default server. Format: <namespace>/<name>.
If not set, certificate and key in the file "/etc/nginx/secrets/default" are used. If a secret is set,
but the Ingress controller is not able to fetch it from Kubernetes API or a secret is not set and
the file "/etc/nginx/secrets/default" does not exist, the Ingress controller will fail to start`)

versionFlag = flag.Bool("version", false, "Print the version and git-commit hash and exit.")
versionFlag = flag.Bool("version", false, "Print the version and git-commit hash and exit")
)

func main() {

0 comments on commit 1144d00

Please sign in to comment.