Cloud Native 9 min read

How to Install and Use the kubectl ingress-nginx Plugin Offline with Krew

This guide walks you through installing Krew, the kubectl plugin manager, then shows step‑by‑step offline installation of the ingress‑nginx plugin and demonstrates key commands for inspecting backends, certificates, and generated Nginx configurations, empowering efficient Kubernetes cloud‑native operations.

Linux Ops Smart Journey
Linux Ops Smart Journey
Linux Ops Smart Journey
How to Install and Use the kubectl ingress-nginx Plugin Offline with Krew

Krew Introduction and Installation

Krew is a plugin manager for the

kubectl

command‑line tool. It helps you discover kubectl plugins, install them on your machine, and keep installed plugins up to date.

Offline Installation of Krew

1. Download the Krew package:

<code>$ curl -LO https://github.com/kubernetes-sigs/krew/releases/download/v0.4.4/krew-linux_amd64.tar.gz</code>

2. Download the Krew manifest file:

<code>$ curl -LO https://github.com/kubernetes-sigs/krew/releases/download/v0.4.4/krew.yaml</code>

3. Install Krew:

<code>tempDir=$(mktemp -d)
 tar xvf krew-linux_amd64.tar.gz -C ${tempDir}
 ${tempDir}/krew-linux_amd64 install --manifest=krew.yaml --archive=krew-linux_amd64.tar.gz
# Add Krew to PATH (temporary)
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
# For permanent use, add the line above to ~/.bashrc or ~/.zshrc</code>

Offline Installation of ingress-nginx Plugin

1. Download the ingress‑nginx binary package:

<code>$ curl -LO https://github.com/kubernetes/ingress-nginx/releases/download/controller-0.31.0/kubectl-ingress_nginx-linux-amd64.tar.gz</code>

2. Download the plugin manifest:

<code>$ curl -LO https://github.com/kubernetes-sigs/krew-index/raw/refs/heads/master/plugins/ingress-nginx.yaml</code>

3. Install the plugin using Krew:

<code>$ kubectl krew install --manifest ingress-nginx.yaml --archive kubectl-ingress_nginx-linux-amd64.tar.gz
# After installation you can run:
#   kubectl ingress-nginx
# Documentation: https://kubernetes.github.io/ingress-nginx/kubectl-plugin/</code>

Using the ingress-nginx Plugin

1. List backends:

<code>$ kubectl ingress-nginx -n kube-system backends --list</code>

2. Inspect a specific backend (example

default-simple-80

):

<code>$ kubectl ingress-nginx -n kube-system backends --backend default-simple-80
{
  "endpoints": [{"address": "10.244.135.161", "port": "1234"}],
  "name": "default-simple-80",
  "port": 80,
  "service": {"spec": {"clusterIP": "10.98.15.159", "ports": [{"name": "http", "port": 80, "targetPort": 1234}]}}
}</code>

3. Retrieve the TLS certificate for a host:

<code>$ kubectl ingress-nginx -n kube-system certs --host simple.jiaxzeng.com
-----BEGIN CERTIFICATE-----
... (certificate data) ...
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
... (key data) ...
-----END RSA PRIVATE KEY-----</code>

4. Show the generated Nginx configuration for a host:

<code>$ kubectl ingress-nginx -n kube-system conf --host simple.jiaxzeng.com
server {
    server_name simple.jiaxzeng.com;
    listen 80;
    listen [::]:80;
    listen 442 proxy_protocol ssl;
    ... (additional directives) ...
}</code>

Reference Documents

https://github.com/kubernetes-sigs/krew-index/tree/master/plugins

https://krew.sigs.k8s.io/plugins/

Conclusion

The

kubectl ingress-nginx

plugin greatly simplifies day‑to‑day operations, making monitoring and debugging of Ingress‑Nginx more intuitive while deepening your understanding of the Kubernetes environment. Apply these techniques to achieve a more efficient cloud‑native workflow.

cloud nativeKubernetesIngress-NginxKrewkubectl plugin
Linux Ops Smart Journey
Written by

Linux Ops Smart Journey

The operations journey never stops—pursuing excellence endlessly.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.