From bea75a0462011853d8051a057105584a02b4ac15 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Sun, 22 Sep 2019 16:21:12 -0300 Subject: [PATCH] Update kubectl-plugin docs --- docs/kubectl-plugin.md | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/docs/kubectl-plugin.md b/docs/kubectl-plugin.md index 4a72fc0f64..f7bcdccbc6 100644 --- a/docs/kubectl-plugin.md +++ b/docs/kubectl-plugin.md @@ -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: @@ -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 ` and `--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 ` and `--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 @@ -161,10 +165,12 @@ Add the `--list` option to show only the backend names. Add the `--backend ` 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 ` 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----- @@ -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 ` 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 ; @@ -212,28 +218,16 @@ $ 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 @@ -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. ```console -$ kubectl ingress-nginx general +$ kubectl ingress-nginx general -n ingress-nginx { "controllerPodsCount": 1 }