Ingress and the Gateway API
How HTTP traffic reaches the right Service by host and path, why Ingress needs a controller, and why the Gateway API is its recommended successor.
Diagrams in this video · 3Free in archhy
Now try it on a real cluster
The videos are free. Gazeek's hands-on labs give you a real Kubernetes cluster in your browser for every lab, with checks that tell you when you've got it right: the practice the CKA and CKAD exams need.
The diagrams, full size
Copy any of them into archhy, free, and change it for your own system.
After this lesson you can
- Explain HTTP routing into a cluster by host name and path
- Describe what an Ingress is and why it needs an Ingress controller
- Describe the Gateway API's main kinds, GatewayClass, Gateway and HTTPRoute
- Explain why the Kubernetes project recommends Gateway over Ingress
Transcript
Ingress and the Gateway API
Space Llama here. Last time, Services. Today, the front door. When web traffic arrives from the internet, which Service should get it? We'll cover Ingress, the controllers that run it, and the Gateway API that follows it.
Routing by host and path
A LoadBalancer Service per app works. But that's a load balancer for every app, and a bill for every one. Usually you want one entry point, and rules behind it. Send shop dot example dot com to the shop Service. Send slash API to the API Service. That's routing by host name and by path. The entry point can also handle HTTPS for every app.
Ingress
An Ingress is a Kubernetes object that holds those rules. Hosts and paths, and the Service for each. On its own, an Ingress does nothing. It needs an Ingress controller running in the cluster. The controller reads the rules and configures a real proxy or load balancer to follow them. There are many controllers to choose from, from clouds and from proxy projects.
From the internet to a Service
Here's the path a request takes. Users on the internet reach a load balancer, the cluster's public front door. Behind it is the Ingress, or a Gateway. It reads the host name and path of each request. One rule sends the request to the first Service. Another sends it to the second. From there, each Service hands the request to one of its Pods, just like last lesson.
The Gateway API
The Gateway API is the newer way to do this, and the successor to Ingress. It's an add-on, a family of API kinds, built to be more expressive and extensible. A GatewayClass names the controller that does the work. A Gateway is the entry point, with listeners for ports and protocols. And an HTTPRoute holds the rules that send requests to your Services. The pieces are split by role. A platform team runs the Gateway. App teams write their own routes.
Ingress is frozen
One more thing. The Kubernetes project now recommends Gateway instead of Ingress. The Ingress API is frozen. It still works, and there are no plans to remove it. But it won't get new features. Moving from Ingress to Gateway takes a one-time conversion. Lots of clusters still run Ingress, so you'll meet both.
Recap
Let's recap. Ingress and Gateway route HTTP traffic into Services, by host name and path. An Ingress does nothing without an Ingress controller. The Gateway API is its successor, built from GatewayClass, Gateway and HTTPRoute. And the Ingress API is frozen. It stays, but new work belongs to Gateway.
Practice and what's next
That's the front door. Wipe your hooves on the way in. Practice it at Gazeek Labs, with free Kubernetes practice questions and hands-on labs on a real cluster. Next up, ConfigMaps and Secrets. See you there. More videos on the channel. Alpaca Mango. I'll be there. I'm always there. Mate.
Hands-on labs
Now try it on a real cluster
Route traffic with an Ingress: a real cluster built for you, checked as you go.
Open the labGazeek Flash · free
Exam questions on your phone
Free questions on Networking: quick-fire batches and timed exams, on the web or Android.







