Skip to content

Commit

Permalink
Merge pull request #295 from nginxinc/report-status
Browse files Browse the repository at this point in the history
Report version information
  • Loading branch information
pleshakov authored Jun 15, 2018
2 parents bda409f + c52b602 commit 5f16c3e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
45 changes: 45 additions & 0 deletions docs/cli-arguments.md
Original file line number Diff line number Diff line change
@@ -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: <namespace>/<name>.
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: <namespace>/<name>
-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
```
2 changes: 1 addition & 1 deletion docs/nginx-ingress-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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** |
Expand Down
8 changes: 8 additions & 0 deletions nginx-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"net/http"
"os"
"os/signal"
Expand Down Expand Up @@ -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: <namespace>/<name>.
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
Expand Down

0 comments on commit 5f16c3e

Please sign in to comment.