Skip to content
IT glossary
DevOps and cloudUpdated December 3, 2026

Kubernetes Ingress

Ingress

This Kubernetes resource tells an Ingress controller where to send incoming web requests. It can route requests to different applications based on the hostname or URL path, even when they share one entry point.

What Ingress does

Suppose a storefront and its API run in the same cluster. You want users to open shop.example.com for the storefront and shop.example.com/api for the API. An Ingress lets you describe those routes without giving each app its own external address. Each route typically points to a Kubernetes Service, which gives clients a stable way to reach a changing set of Pods.

The resource is not the proxy

An Ingress is a set of rules stored in the Kubernetes API. An Ingress controller watches those rules and configures the reverse proxy or load balancer that actually handles traffic. ingressClassName refers to an IngressClass and determines which implementation should handle the rules. If no controller handles that class, applying the manifest can succeed without making the app reachable.

In a typical setup, DNS resolves the hostname to the address serving the controller's routes. The proxy matches the request's hostname and path, then forwards it to the selected backend. A Service in the rule must be in the same namespace as the Ingress. Some controllers route through the Service's virtual IP; others send traffic straight to its backend endpoints. For HTTPS, the controller can terminate TLS at the entry point using a certificate and key from the Secret named in spec.tls.

Example: route requests to an API

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop-api
spec:
  ingressClassName: public
  rules:
    - host: shop.example.com
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: shop-api
                port:
                  number: 80

This assumes the cluster already has a working public class and a shop-api Service that exposes port 80. That is the Service port, not necessarily the port the container listens on. Prefix matches whole path segments, so /api/orders matches but /apiv2 does not. The rule doesn't strip /api; if your app expects /orders, you need an explicit rewrite supported by your controller or a change to the app.

When to use it and what interviewers ask

Use Ingress when several web apps need to share an entry point and be selected by hostname or path. A LoadBalancer Service exposes an individual Service but does not, by itself, define HTTP routing. Standard Ingress does not cover arbitrary TCP or UDP traffic. The Ingress API is stable but frozen; Kubernetes develops newer routing capabilities in Gateway API.

An interviewer might ask why a valid Ingress returns 404. First determine whether the proxy or the app produced the response. A proxy response can point to a rule mismatch: check the hostname, the path, and whether the intended controller picked up the resource. If the app produced the response, check the path it actually received. A successful kubectl apply only confirms that Kubernetes accepted the configuration, not that traffic can reach the backend.