Ingress and External Routing
Expose multiple services to the outside world through a single entry point using Ingress resources, host and path routing, and an Ingress controller.
Ingress and External Routing is a free Docker & DevOps Fundamentals lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Docker & DevOps Fundamentals learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Beyond NodePort and LoadBalancer
A Service can expose an app, but giving every app its own external IP gets expensive and messy. Ingress provides one smart HTTP entry point that routes to many services.
What Is an Ingress?
An Ingress is a Kubernetes object describing HTTP/HTTPS routing rules: which host or URL path maps to which Service.
You Need a Controller
The Ingress object is just rules. An Ingress controller (nginx, Traefik, HAProxy) actually watches those rules and does the routing. No controller, no effect.
kubectl get pods -n ingress-nginxA Basic Ingress
This Ingress sends all traffic to a single backend Service on port 80.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web-ingress
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80Host-Based Routing
Add a host to route by domain name - api.example.com to one service, shop.example.com to another, all on the same IP.
rules:
- host: api.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api
port:
number: 8080Path-Based Routing
Or route by URL path under one host: /api to the API service, / to the web frontend.
paths:
- path: /api
pathType: Prefix
backend:
service:
name: api
port:
number: 8080
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80TLS Termination
Ingress can terminate HTTPS using a TLS secret, so your services receive plain HTTP while users get encryption.
spec:
tls:
- hosts:
- shop.example.com
secretName: shop-tlsAnnotations Tune Behaviour
Controller-specific annotations configure rewrites, timeouts, rate limits, and more. They live on the Ingress metadata.
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /IngressClass
When multiple controllers exist, ingressClassName tells Kubernetes which one should handle this Ingress.
spec:
ingressClassName: nginxInspecting Ingress
Check your rules and the assigned address with kubectl get ingress and describe for events.
kubectl describe ingress web-ingressThe Modern Alternative: Gateway API
Kubernetes is evolving toward the Gateway API, a more expressive successor to Ingress. Ingress remains widely used and is the right starting point.
Quick Check
Why is an Ingress controller required?
Recap
You can now expose apps cleanly:
- Ingress defines HTTP routing rules; an Ingress controller enforces them
- Route by host or path through one entry point
- Terminate TLS and tune behaviour with annotations
ingressClassNamepicks the controller
One IP, many services, smart routing.
Frequently asked questions
Is the “Ingress and External Routing” lesson free?
Yes — the full text of “Ingress and External Routing” is free to read here on the web, and the Docker & DevOps Fundamentals course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Docker & DevOps Fundamentals course, upgrade to CoddyKit PRO.
What will I learn in “Ingress and External Routing”?
Expose multiple services to the outside world through a single entry point using Ingress resources, host and path routing, and an Ingress controller. You practise Docker & DevOps Fundamentals with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Docker & DevOps Fundamentals?
No prior experience is required. Docker & DevOps Fundamentals on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Ingress and External Routing” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Docker & DevOps Fundamentals lesson?
Yes. Every Docker & DevOps Fundamentals lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Deployments for Stateless Apps
- Services for Network Access
- ConfigMaps & Secrets
- Ingress and External Routing