A Kubernetes Ingress is a collection of rules for routing HTTP/S traffic to Kubernetes Service objects. It operates at Layer 7 (HTTP/HTTPS).

🌐 Purpose

  • Route external traffic to services based on host/path
  • Provide TLS termination
  • Share one IP for many services
flowchart TD

  client[Client]

  ingress[Ingress Controller]

  svc1[Service A<br/>host: foo.com]

  svc2[Service B<br/>host: bar.com]

  

  client --> ingress

  ingress --> svc1

  ingress --> svc2

  

  style ingress fill:#faa,stroke:#333,stroke-width:2px

  style svc1 fill:#bbf,stroke:#333

  style svc2 fill:#bbf,stroke:#333

🛠 Requires

  • An [[Ingress Controller]] (e.g., NGINX, Traefik, HAProxy)

🔧 Example

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