</code></pre></div><p>to install the plugin. Then run</p><divclass=highlight><pre><span></span><code><spanclass=go>kubectl ingress-nginx --help</span>
</code></pre></div><p>to make sure the plugin is properly installed and to get a list of commands:</p><divclass=highlight><pre><span></span><code><spanclass=go>kubectl ingress-nginx --help</span>
<spanclass=go>A kubectl plugin for inspecting your ingress-nginx deployments</span>
<spanclass=go>Usage:</span>
<spanclass=go> ingress-nginx [command]</span>
<spanclass=go>Available Commands:</span>
<spanclass=go> backends Inspect the dynamic backend information of an ingress-nginx instance</span>
<spanclass=go> certs Output the certificate data stored in an ingress-nginx pod</span>
<spanclass=go> conf Inspect the generated nginx.conf</span>
<spanclass=go> exec Execute a command inside an ingress-nginx pod</span>
<spanclass=go> general Inspect the other dynamic ingress-nginx information</span>
<spanclass=go> help Help about any command</span>
<spanclass=go> info Show information about the ingress-nginx service</span>
<spanclass=go> ingresses Provide a short summary of all of the ingress definitions</span>
<spanclass=go> lint Inspect kubernetes resources for possible issues</span>
<spanclass=go> logs Get the kubernetes logs for an ingress-nginx pod</span>
<spanclass=go> ssh ssh into a running ingress-nginx pod</span>
<spanclass=go>Flags:</span>
<spanclass=go> --as string Username to impersonate for the operation</span>
<spanclass=go> --as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.</span>
<spanclass=go> --certificate-authority string Path to a cert file for the certificate authority</span>
<spanclass=go> --client-certificate string Path to a client certificate file for TLS</span>
<spanclass=go> --client-key string Path to a client key file for TLS</span>
<spanclass=go> --cluster string The name of the kubeconfig cluster to use</span>
<spanclass=go> --context string The name of the kubeconfig context to use</span>
<spanclass=go> -h, --help help for ingress-nginx</span>
<spanclass=go> --insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure</span>
<spanclass=go> --kubeconfig string Path to the kubeconfig file to use for CLI requests.</span>
<spanclass=go> -n, --namespace string If present, the namespace scope for this CLI request</span>
<spanclass=go> --request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")</span>
<spanclass=go> -s, --server string The address and port of the Kubernetes API server</span>
<spanclass=go> --token string Bearer token for authentication to the API server</span>
<spanclass=go> --user string The name of the kubeconfig user to use</span>
<spanclass=go>Use "ingress-nginx [command] --help" for more information about a command.</span>
</code></pre></div><h2id=common-flags>Common Flags<aclass=headerlinkhref=#common-flagstitle="Permanent link"> ¶</a></h2><ul><li>Every subcommand supports the basic <code>kubectl</code> configuration flags like <code>--namespace</code>, <code>--context</code>, <code>--client-key</code> and so on.</li><li>Subcommands that act on a particular <code>ingress-nginx</code> pod (<code>backends</code>, <code>certs</code>, <code>conf</code>, <code>exec</code>, <code>general</code>, <code>logs</code>, <code>ssh</code>), support the <code>--deployment <deployment></code>, <code>--pod <pod></code>, and <code>--container <container></code> flags to select either a pod from a deployment with the given name, or a pod with the given name (and the given container name). The <code>--deployment</code> flag defaults to <code>ingress-nginx-controller</code>, and the <code>--container</code> flag defaults to <code>controller</code>.</li><li>Subcommands that inspect resources (<code>ingresses</code>, <code>lint</code>) support the <code>--all-namespaces</code> flag, which causes them to inspect resources in every namespace.</li></ul><h2id=subcommands>Subcommands<aclass=headerlinkhref=#subcommandstitle="Permanent link"> ¶</a></h2><p>Note that <code>backends</code>, <code>general</code>, <code>certs</code>, and <code>conf</code> require <code>ingress-nginx</code> version <code>0.23.0</code> or higher.</p><h3id=backends>backends<aclass=headerlinkhref=#backendstitle="Permanent link"> ¶</a></h3><p>Run <code>kubectl ingress-nginx backends</code> to get a JSON array of the backends that an ingress-nginx controller currently knows about:</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>backends<spanclass=w></span>-n<spanclass=w></span>ingress-nginx
</code></pre></div><p>Add the <code>--list</code> option to show only the backend names. Add the <code>--backend <backend></code> option to show only the backend with the given name.</p><h3id=certs>certs<aclass=headerlinkhref=#certstitle="Permanent link"> ¶</a></h3><p>Use <code>kubectl ingress-nginx certs --host <hostname></code> to dump the SSL cert/key information for a given host.</p><p><strong>WARNING:</strong> This command will dump sensitive private key information. Don't blindly share the output, and certainly don't log it anywhere.</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>certs<spanclass=w></span>-n<spanclass=w></span>ingress-nginx<spanclass=w></span>--host<spanclass=w></span>testaddr.local
</code></pre></div><h3id=conf>conf<aclass=headerlinkhref=#conftitle="Permanent link"> ¶</a></h3><p>Use <code>kubectl ingress-nginx conf</code> to dump the generated <code>nginx.conf</code> file. Add the <code>--host <hostname></code> option to view only the server block for that host:</p><divclass=highlight><pre><span></span><code><spanclass=go>kubectl ingress-nginx conf -n ingress-nginx --host testaddr.local</span>
</code></pre></div><h3id=exec>exec<aclass=headerlinkhref=#exectitle="Permanent link"> ¶</a></h3><p><code>kubectl ingress-nginx exec</code> is exactly the same as <code>kubectl exec</code>, with the same command flags. It will automatically choose an <code>ingress-nginx</code> pod to run the command in.</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span><spanclass=nb>exec</span><spanclass=w></span>-i<spanclass=w></span>-n<spanclass=w></span>ingress-nginx<spanclass=w></span>--<spanclass=w></span>ls<spanclass=w></span>/etc/nginx
</code></pre></div><h3id=info>info<aclass=headerlinkhref=#infotitle="Permanent link"> ¶</a></h3><p>Shows the internal and external IP/CNAMES for an <code>ingress-nginx</code> service.</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>info<spanclass=w></span>-n<spanclass=w></span>ingress-nginx
</code></pre></div><p>Use the <code>--service <service></code> flag if your <code>ingress-nginx</code><code>LoadBalancer</code> service is not named <code>ingress-nginx</code>.</p><h3id=ingresses>ingresses<aclass=headerlinkhref=#ingressestitle="Permanent link"> ¶</a></h3><p><code>kubectl ingress-nginx ingresses</code>, alternately <code>kubectl ingress-nginx ing</code>, shows a more detailed view of the ingress definitions in a namespace.</p><p>Compare:</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>get<spanclass=w></span>ingresses<spanclass=w></span>--all-namespaces
</code></pre></div><h3id=lint>lint<aclass=headerlinkhref=#linttitle="Permanent link"> ¶</a></h3><p><code>kubectl ingress-nginx lint</code> can check a namespace or entire cluster for potential configuration issues. This command is especially useful when upgrading between <code>ingress-nginx</code> versions.</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>lint<spanclass=w></span>--all-namespaces<spanclass=w></span>--verbose
</code></pre></div><p>To show the lints added <strong>only</strong> for a particular <code>ingress-nginx</code> release, use the <code>--from-version</code> and <code>--to-version</code> flags:</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>lint<spanclass=w></span>--all-namespaces<spanclass=w></span>--verbose<spanclass=w></span>--from-version<spanclass=w></span><spanclass=m>0</span>.24.0<spanclass=w></span>--to-version<spanclass=w></span><spanclass=m>0</span>.24.0
</code></pre></div><h3id=logs>logs<aclass=headerlinkhref=#logstitle="Permanent link"> ¶</a></h3><p><code>kubectl ingress-nginx logs</code> is almost the same as <code>kubectl logs</code>, with fewer flags. It will automatically choose an <code>ingress-nginx</code> pod to read logs from.</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>logs<spanclass=w></span>-n<spanclass=w></span>ingress-nginx
<spanclass=go>W0405 16:53:46.070093 7 client_config.go:549] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.</span>
<spanclass=go>I0405 16:53:46.070499 7 main.go:205] Creating API client for https://10.96.0.1:443</span>
<spanclass=go>I0405 16:53:46.077784 7 main.go:249] Running in Kubernetes cluster version v1.10 (v1.10.11) - git (clean) commit 637c7e288581ee40ab4ca210618a89a555b6e7e9 - platform linux/amd64</span>
</code></pre></div><h3id=ssh>ssh<aclass=headerlinkhref=#sshtitle="Permanent link"> ¶</a></h3><p><code>kubectl ingress-nginx ssh</code> is exactly the same as <code>kubectl ingress-nginx exec -it -- /bin/bash</code>. Use it when you want to quickly be dropped into a shell inside a running <code>ingress-nginx</code> container.</p><divclass=highlight><pre><span></span><code><spanclass=gp>$ </span>kubectl<spanclass=w></span>ingress-nginx<spanclass=w></span>ssh<spanclass=w></span>-n<spanclass=w></span>ingress-nginx
</code></pre></div></article></div></div></main><footerclass=md-footer><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><divclass=md-dialogdata-md-component=dialog><divclass="md-dialog__inner md-typeset"></div></div><scriptid=__configtype=application/json>{"base":"..","features":["navigation.tabs","navigation.tabs.sticky","navigation.instant","navigation.sections"],"search":"../assets/javascripts/workers/search.f886a092.min.js","translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"}}</script><scriptsrc=../assets/javascripts/bundle.aecac24b.min.js></script></body></html>