CONTAINERS / A CONCEPT NOTE

Kubernetes Ingress

routing external traffic to services inside your cluster

~75 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

An Ingress is a Kubernetes resource that exposes HTTP/HTTPS routes from outside the cluster to services inside. Instead of creating a LoadBalancer for every service, you create one Ingress that routes requests based on hostnames (api.example.com) and paths (/users, /orders) to different backend services.

02 / FOLLOW THE MECHANISM

How an ingress routes traffic

  1. External client

    sends GET https://api.example.com/users to the Ingress controller's IP.

  2. Ingress controller

    terminates TLS, examines the Host header and path.

  3. Controller

    matches against Ingress rules — Host: api.example.com + path /users → service: user-svc, port: 8080.

  4. Service

    forwards the request to an available pod matching the service's selector labels.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

list all ingress resources

kubectl get ingress -A

EXAMPLE 02 · REFERENCE

show routing rules and TLS config

kubectl describe ingress my-ingress

Explore command anatomy in the CLI lab