🎯 What It Is

An Ingress is a Kubernetes resource that manages external HTTP/S access to services in your cluster β€” typically via hostnames, paths, and TLS.

βœ… Without Ingress: You’d need NodePort or LoadBalancer for every service.

πŸ”’ With Ingress: One entry point routes traffic to many services.

πŸ’‘ Real-World Analogy

Like a reception desk in an office building:


πŸ§ͺ Example: Expose Two Apps via One Ingress

Assume you have:

Step 1: Create an Ingress Resource

# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
meta
  name: main-ingress
  namespace: default
spec:
  rules:
  - host: web.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: web
            port:
              number: 80

  - host: api.example.com
    http:
      paths:
      - path: /v1
        pathType: Prefix
        backend:
          service:
            name: api
            port:
              number: 80

Apply it:

kubectl apply -f ingress.yaml

βœ… Result:

⚠️ But wait! This won’t work yet β€” you need an Ingress Controller (next topic).


βœ… Summary YAML