diff --git a/docs/cli-arguments.md b/docs/cli-arguments.md new file mode 100644 index 0000000000..1e5448de98 --- /dev/null +++ b/docs/cli-arguments.md @@ -0,0 +1,45 @@ +# Ingress Controller Command-line Arguments + +``` +Usage of ./nginx-ingress: + -alsologtostderr + 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: /. + If not specified, the key and the cert from /etc/nginx/secrets/default is used. + -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. + -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") + -log_backtrace_at value + when logging hits line file:N, emit a stack trace + -log_dir string + If non-empty, write log files in this directory + -logtostderr + 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: / + -nginx-plus + Enables 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. + -stderrthreshold value + 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 + -v value + log level for V logs + -version + Print the version and git-commit hash and exit. + -vmodule value + 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 +``` \ No newline at end of file diff --git a/docs/nginx-ingress-controllers.md b/docs/nginx-ingress-controllers.md index 733a259d83..a7e74c1f50 100644 --- a/docs/nginx-ingress-controllers.md +++ b/docs/nginx-ingress-controllers.md @@ -27,7 +27,7 @@ The table below summarizes the key difference between nginxinc/kubernetes-ingres | Session persistence | Supported via a third-party module | Not supported | Supported | | Configuration templates *1 | See the [template](https://github.com/kubernetes/ingress-nginx/blob/master/rootfs/etc/nginx/template/nginx.tmpl) | See the [templates](https://github.com/nginxinc/kubernetes-ingress/tree/master/nginx-controller/nginx/templates) | See the [templates](https://github.com/nginxinc/kubernetes-ingress/tree/master/nginx-controller/nginx/templates) | | **Deployment** | -| Command-line arguments *2 | See the [arguments](https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/cli-arguments.md) | See the [arguments](https://github.com/nginxinc/kubernetes-ingress/blob/master/nginx-controller/main.go#L27) | See the [arguments](https://github.com/nginxinc/kubernetes-ingress/blob/master/nginx-controller/main.go#L27) | +| Command-line arguments *2 | See the [arguments](https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/cli-arguments.md) | See the [arguments](cli-arguments.md) | See the [arguments](cli-arguments.md) | | TLS certificate and key for the default server | Required as a command-line argument/ auto-generated | Required as a command-line argument | Required as a command-line argument | | Helm chart | Supported | Supported | Supported | | **Operational** | diff --git a/nginx-controller/main.go b/nginx-controller/main.go index c5521569e8..9e01d7e8d4 100644 --- a/nginx-controller/main.go +++ b/nginx-controller/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "net/http" "os" "os/signal" @@ -57,12 +58,19 @@ var ( `Specifies a secret with a TLS certificate and key for SSL termination of the default server. The value must follow the following format: /. If not specified, the key and the cert from /etc/nginx/secrets/default is used.`) + + versionFlag = flag.Bool("version", false, "Print the version and git-commit hash and exit.") ) func main() { flag.Parse() flag.Lookup("logtostderr").Value.Set("true") + if *versionFlag { + fmt.Printf("Version=%v GitCommit=%v\n", version, gitCommit) + os.Exit(0) + } + glog.Infof("Starting NGINX Ingress controller Version=%v GitCommit=%v\n", version, gitCommit) var err error