Update kubectl-plugin docs (#4582)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-09-22 16:39:19 -03:00 committed by GitHub
parent c1ed6db468
commit ba38153561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,17 +11,21 @@ Do not move it without providing redirects.
## Installation ## Installation
Install [krew](https://github.com/GoogleContainerTools/krew), then run Install [krew](https://github.com/GoogleContainerTools/krew), then run
```console ```console
$ kubectl krew install ingress-nginx kubectl krew install ingress-nginx
``` ```
to install the plugin. Then run to install the plugin. Then run
```console ```console
$ kubectl ingress-nginx --help kubectl ingress-nginx --help
``` ```
to make sure the plugin is properly installed and to get a list of commands: to make sure the plugin is properly installed and to get a list of commands:
```console ```console
$ kubectl ingress-nginx --help kubectl ingress-nginx --help
A kubectl plugin for inspecting your ingress-nginx deployments A kubectl plugin for inspecting your ingress-nginx deployments
Usage: Usage:
@ -76,9 +80,9 @@ Replacing `0.24.0` with the recently released version.
## Common Flags ## Common Flags
- Every subcommand supports the basic `kubectl` configuration flags like `--namespace`, `--context`, `--client-key` and so on. - Every subcommand supports the basic `kubectl` configuration flags like `--namespace`, `--context`, `--client-key` and so on.
- Subcommands that act on a particular `ingress-nginx` pod (`backends`, `certs`, `conf`, `exec`, `general`, `logs`, `ssh`), support the `--deployment <deployment>` and `--pod <pod>` flags to select either a pod from a deployment with the given name, or a pod with the given name. The `--deployment` flag defaults to `nginx-ingress-controller`. - Subcommands that act on a particular `ingress-nginx` pod (`backends`, `certs`, `conf`, `exec`, `general`, `logs`, `ssh`), support the `--deployment <deployment>` and `--pod <pod>` flags to select either a pod from a deployment with the given name, or a pod with the given name. The `--deployment` flag defaults to `nginx-ingress-controller`.
- Subcommands that inspect resources (`ingresses`, `lint`) support the `--all-namespaces` flag, which causes them to inspect resources in every namespace. - Subcommands that inspect resources (`ingresses`, `lint`) support the `--all-namespaces` flag, which causes them to inspect resources in every namespace.
## Subcommands ## Subcommands
@ -161,10 +165,12 @@ Add the `--list` option to show only the backend names. Add the `--backend <back
### certs ### certs
Use `kubectl ingress-nginx certs --host <hostname>` to dump the SSL cert/key information for a given host. Requires that `--enable-dynamic-certificates` is `true` (this is the default as of version `0.24.0`). WARNING: This command will dump sensitive private key information. Don't blindly share the output, and certainly don't log it anywhere. Use `kubectl ingress-nginx certs --host <hostname>` to dump the SSL cert/key information for a given host. Requires that `--enable-dynamic-certificates` is `true` (this is the default as of version `0.24.0`).
**WARNING:** This command will dump sensitive private key information. Don't blindly share the output, and certainly don't log it anywhere.
```console ```console
$ kubectl ingress-nginx certs --host testaddr.local -n ingress-nginx $ kubectl ingress-nginx certs -n ingress-nginx --host testaddr.local
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
... ...
-----END CERTIFICATE----- -----END CERTIFICATE-----
@ -182,7 +188,7 @@ $ kubectl ingress-nginx certs --host testaddr.local -n ingress-nginx
Use `kubectl ingress-nginx conf` to dump the generated `nginx.conf` file. Add the `--host <hostname>` option to view only the server block for that host: Use `kubectl ingress-nginx conf` to dump the generated `nginx.conf` file. Add the `--host <hostname>` option to view only the server block for that host:
```console ```console
$ kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local
server { server {
server_name testaddr.local ; server_name testaddr.local ;
@ -212,28 +218,16 @@ $ kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local
```console ```console
$ kubectl ingress-nginx exec -i -n ingress-nginx -- ls /etc/nginx $ kubectl ingress-nginx exec -i -n ingress-nginx -- ls /etc/nginx
fastcgi.conf
fastcgi.conf.default
fastcgi_params fastcgi_params
fastcgi_params.default
geoip geoip
koi-utf
koi-win
lua lua
mime.types mime.types
mime.types.default
modsecurity modsecurity
modules modules
nginx.conf nginx.conf
nginx.conf.default
opentracing.json opentracing.json
owasp-modsecurity-crs owasp-modsecurity-crs
scgi_params
scgi_params.default
template template
uwsgi_params
uwsgi_params.default
win-utf
``` ```
### general ### general
@ -241,7 +235,7 @@ win-utf
`kubectl ingress-nginx general` dumps miscellaneous controller state as a JSON object. Currently it just shows the number of controller pods known to a particular controller pod. `kubectl ingress-nginx general` dumps miscellaneous controller state as a JSON object. Currently it just shows the number of controller pods known to a particular controller pod.
```console ```console
$ kubectl ingress-nginx general $ kubectl ingress-nginx general -n ingress-nginx
{ {
"controllerPodsCount": 1 "controllerPodsCount": 1
} }