Home KubernetesHow to Install NGINX Ingress Controller on Kubernetes with Helm

How to Install NGINX Ingress Controller on Kubernetes with Helm

by Knowledge Base Linux
How to Install NGINX Ingress Controller — How to Install NGINX Ingress Controller on Kubernetes with Helm

A LoadBalancer Service gives each application its own public IP and its own cloud bill. As soon as you run several web apps on one cluster, you need a smarter front door: one entry point that routes traffic by hostname and URL path. That is exactly what you get when you install an NGINX Ingress controller on Kubernetes. In this guide you will install an NGINX Ingress controller on Kubernetes with Helm, create Ingress rules for two demo applications, and add a free TLS certificate with cert-manager. By the end, https://shop.example.com and https://blog.example.com will both be served through a single load balancer.

What an Ingress Controller Actually Does

An Ingress is a Kubernetes object containing HTTP routing rules: hostnames, paths, and the Services behind them. By itself it does nothing — an Ingress controller is the software that reads those rules and configures a real reverse proxy. The NGINX Ingress controller (ingress-nginx) is the most widely used option: it runs NGINX inside pods, watches the Kubernetes API, and reloads its configuration whenever your Ingress objects change.

The traffic flow looks like this: user → cloud load balancer → NGINX Ingress controller pods → your ClusterIP Service → application pods. If the service types are still fuzzy, review our explainer on Kubernetes Services: ClusterIP, NodePort, LoadBalancer first.

Prerequisites

  • A running Kubernetes cluster (cloud or self-managed) with kubectl access.
  • Helm 3 installed on your machine. Our Helm chart tutorial covers installation if you need it.
  • A domain name whose DNS you control, pointed at the load balancer IP you will get in step 1.
  • Two demo applications, or your own apps, exposed as ClusterIP Services.

Step 1: Install NGINX Ingress Controller on Kubernetes with Helm

Add the ingress-nginx Helm repository and install the chart into its own namespace:

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx \
  --namespace ingress-nginx --create-namespace

Watch the controller service until it receives an external IP:

kubectl get svc -n ingress-nginx -w
NAME                       TYPE           EXTERNAL-IP
ingress-nginx-controller   LoadBalancer   203.0.113.15

On a bare-metal or local cluster there is no cloud provider to fulfil the LoadBalancer, so the IP stays <pending>. For local testing you can install with --set controller.service.type=NodePort instead, or use a tool such as MetalLB or Minikube’s tunnel.

https://kblinux.com/wp-content/uploads/2026/10/media-generation-k8s-ingress-routing-0-20f15506-610b-4a66-9214-44659cfc5f5d.webp

Step 2: Deploy Two Demo Applications

Create two simple deployments with ClusterIP services:

kubectl create deployment shop --image=nginx --replicas=2
kubectl expose deployment shop --port=80
kubectl create deployment blog --image=httpd --replicas=2
kubectl expose deployment blog --port=80

Step 3: Create the Ingress Rules

Now define one Ingress that routes by hostname:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx
  rules:
  - host: shop.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: shop
            port:
              number: 80
  - host: blog.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: blog
            port:
              number: 80
kubectl apply -f web-ingress.yaml
kubectl get ingress

Point the DNS A records for both hostnames at the load balancer IP from step 1. Within a few minutes, each domain serves its own application through the shared entry point. Path-based routing works the same way: two paths entries under one host can send /api to one service and / to another.

Step 4: Add Free TLS with cert-manager

Install cert-manager and create a Let’s Encrypt cluster issuer:

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager \
  --namespace cert-manager --create-namespace \
  --set crds.enabled=true
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: [email protected]
    privateKeySecretRef:
      name: letsencrypt-prod
    solvers:
    - http01:
        ingress:
          class: nginx

Then annotate your Ingress with cert-manager.io/cluster-issuer: letsencrypt-prod and add a tls: section listing the hosts and a secret name. cert-manager will request, store, and renew the certificates automatically.

Troubleshooting the NGINX Ingress Controller on Kubernetes

  • 404 from NGINX default backend: no rule matched. Check that the Ingress has ingressClassName: nginx and that the hostname in the request matches a rule exactly.
  • 503 Service Temporarily Available: the backend Service has no ready endpoints — check the pods behind it.
  • EXTERNAL-IP stuck on pending: expected without a cloud provider or MetalLB; use NodePort mode locally.
  • Certificate not issued: inspect with kubectl describe certificate and kubectl get certificaterequests; usually DNS does not point at the controller yet, so the HTTP-01 challenge cannot be reached.
  • Controller logs: kubectl logs -n ingress-nginx deploy/ingress-nginx-controller shows every request and reload.

Useful Annotations When You Install NGINX Ingress Controller on Kubernetes

Annotations on the Ingress object unlock most controller features without extra components. Three you will reach for constantly: nginx.ingress.kubernetes.io/proxy-body-size: "20m" raises the upload limit for file-heavy applications; nginx.ingress.kubernetes.io/limit-rps: "10" adds basic rate limiting per client IP; and nginx.ingress.kubernetes.io/ssl-redirect: "true" forces HTTP traffic onto HTTPS once your certificates are in place. Apply annotations sparingly and document them, because a large pile of per-Ingress tweaks becomes difficult to audit later. When the same behaviour is needed for every route, prefer the controller’s global ConfigMap instead.

Conclusion

Once you install an NGINX Ingress controller on Kubernetes, publishing web applications becomes a matter of writing a few lines of YAML per app: one shared load balancer, hostname and path routing, and automatic HTTPS through cert-manager. It is the standard front door for production clusters and pairs naturally with ClusterIP services behind it. For annotations, rate limiting, canary deployments, and every other controller feature, consult the official ingress-nginx documentation.

You may also like

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.