Chapter 4 got traffic in with NodePort: one high port per Service. Real clusters publish many apps on one address, by name. That is Ingress.
Two parts
The controller is a Deployment like any other, in kube-system, with a Service in front of it. It watches Ingress objects and reconfigures itself. Without a controller, an Ingress is a routing table nobody reads.
kubectl get ingressclass
kubectl get svc -n kube-system traefikAn Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: market
spec:
ingressClassName: traefik
rules:
- host: market.example
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: market-web
port:
number: 80Or in one line: kubectl create ingress market --class=traefik --rule="market.example/*=market-web:80".
Requests arriving with Host: market.example go to the market-web Service on port 80. The Service must exist in the same namespace as the Ingress, and the controller forwards to its endpoints directly.
Testing without DNS
Nothing resolves market.example yet. Send the Host header yourself:
curl -H "Host: market.example" http://10.0.0.10/
curl -H "Host: nope.example" http://10.0.0.10/<h1>Monster Market</h1>
404 page not foundThe second is Traefik's own answer: no rule matched the host.
Reading it
kubectl get ingress
kubectl describe ingress marketNAME CLASS HOSTS ADDRESS PORTS AGE
market traefik market.example 10.0.0.10 80 20sADDRESS is where the controller listens. describe shows each rule with the backend and its current endpoint IPs; <error: services "x" not found> there is the classic typo.