Skip to content

Commit

Permalink
Update kubectl-plugin docs (#4582)
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored Sep 22, 2019
1 parent c1ed6db commit ba38153
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions docs/kubectl-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ Do not move it without providing redirects.
## Installation

Install [krew](https://github.com/GoogleContainerTools/krew), then run

```console
$ kubectl krew install ingress-nginx
kubectl krew install ingress-nginx
```

to install the plugin. Then run

```console
$ kubectl ingress-nginx --help
kubectl ingress-nginx --help
```

to make sure the plugin is properly installed and to get a list of commands:

```console
$ kubectl ingress-nginx --help
kubectl ingress-nginx --help
A kubectl plugin for inspecting your ingress-nginx deployments

Usage:
Expand Down Expand Up @@ -76,9 +80,9 @@ Replacing `0.24.0` with the recently released version.

## Common Flags

- 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 inspect resources (`ingresses`, `lint`) support the `--all-namespaces` flag, which causes them to inspect resources in every namespace.
- 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 inspect resources (`ingresses`, `lint`) support the `--all-namespaces` flag, which causes them to inspect resources in every namespace.

## Subcommands

Expand Down Expand Up @@ -161,10 +165,12 @@ Add the `--list` option to show only the backend names. Add the `--backend <back

### 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
$ kubectl ingress-nginx certs --host testaddr.local -n ingress-nginx
$ kubectl ingress-nginx certs -n ingress-nginx --host testaddr.local
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Expand All @@ -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:

```console
$ kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local
kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local

server {
server_name testaddr.local ;
Expand Down Expand Up @@ -212,36 +218,24 @@ $ kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local

```console
$ kubectl ingress-nginx exec -i -n ingress-nginx -- ls /etc/nginx
fastcgi.conf
fastcgi.conf.default
fastcgi_params
fastcgi_params.default
geoip
koi-utf
koi-win
lua
mime.types
mime.types.default
modsecurity
modules
nginx.conf
nginx.conf.default
opentracing.json
owasp-modsecurity-crs
scgi_params
scgi_params.default
template
uwsgi_params
uwsgi_params.default
win-utf
```

### general

`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
$ kubectl ingress-nginx general
$ kubectl ingress-nginx general -n ingress-nginx
{
"controllerPodsCount": 1
}
Expand Down

0 comments on commit ba38153

Please sign in to comment.