Skip to content

Ingress

In one line

An Ingress is a Kubernetes resource that routes external HTTP/HTTPS traffic to Services based on host and path rules.

In simple words

An Ingress is Kubernetes' way of exposing your application to the outside world using HTTP/HTTPS. Instead of exposing each Service individually, you define an Ingress with routing rules — e.g., "send traffic to /api to the API service, and everything else to the frontend service."

An Ingress can also handle TLS termination (HTTPS), host-based routing (e.g., api.example.com vs www.example.com), and path-based routing. To actually process Ingress rules, you need an Ingress Controller — a pod that runs a reverse proxy like nginx or traefik.

Ingress is more efficient than using multiple LoadBalancer Services because you only need one load balancer (the Ingress Controller) to route to many Services.

Example

yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
    - host: example.com
      http:
        paths:
          - path: /api
            backend:
              service:
                name: api-service
                port:
                  number: 80
          - path: /
            backend:
              service:
                name: web-service
                port:
                  number: 80

This Ingress routes /api to api-service and everything else to web-service for the host example.com.

How it works

  1. You define an Ingress with routing rules (host, path, backend Service).
  2. An Ingress Controller (e.g., nginx-ingress) watches for Ingress resources.
  3. The controller configures its reverse proxy to route traffic accordingly.
  4. External traffic hits the Ingress Controller, which routes it to the right Service.

Common confusions

  • Confused with: Service

    The difference: A Service routes traffic within the cluster; an Ingress routes external HTTP/HTTPS traffic based on host and path rules.

Related terms

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary