Since service meshes are usually deployed on container platforms like Kubernetes, it is perhaps useful to bring some container platform capabilities into view for a more complete picture. So, we have to add two extra products into the equation: The Kubernetes Ingress controller and the Gateway API
Kubernetes ingress controller
Simply stated, a Kubernetes ingress controller is also a type of network gateway and it might come as no surprise when I say there are some overlapping capabilities with both an Api gateway and a service mesh regarding network concerns and http traffic.
Briefly, a Kubernetes ingress controller:
-
Manages external access to services within a cluster
-
Provides basic routing and SSL termination (like an API gateway)
-
manages only http traffic (L7). This is perhaps the biggest difference, as API gateways and service meshes can usually handle also traffic at the TCP/UDP level (L4) or more application protocols then only http(s).
So, an ingress controller mainly serves as an entry endpoint into a Kubernetes cluster. A cluster reverse proxy server so to speak. If you don’t have a Kubernetes platform, there’s no real use for a Kubernetes ingress controller.
When you have a Kubernetes cluster and an API gateway but no service mesh, and all your backend service are implemented on Kubernetes, the API gateway usually forwards all the requests to the ingress controller, who forwards them to the correct internal backend services within the Kubernetes controller.
Gateway API
The Gateway API in Kubernetes is implemented to provide more expressive and extensible ways to manage network traffic then the original ingress controller. It is, therefore, like the ingress controller, part of the Kubernetes eco system.
The Gateway API provides a vendor-neutral API for traffic routing and management and enhances the basic capabilities of an ingress controller. The decision to use a Gateway API or an ingress controller depends on your specific use case and needs. You can always start with the standard ingress controller and when you needs are becoming more complex, you can switch to the Gateway API.
You can use them both in parallel, using the ingress controller for the basic use cases and the Gateway API for the more complex use case like advanced traffic routing or authorisation uses cases for example.
When a service mesh comes into the picture, the Gateway API becomes almost a necessity nowadays. Via the GAMMA initiative, new service mesh use cases are being built into the gateway API, so it makes sense to use a Gateway API when deploying a service mesh on a Kubernetes cluster.
Observe that the Gateway Api and an Api gateway are rather two different beasts with different use cases and different roles. The gateway API leans into the service mesh uses case and capabilities and is thus more focused on internal network traffic than an API gateway.
When you have a Kubernetes cluster, an API gateway and a service mesh, with your backend services implemented on Kubernetes, in a typical scenario, the API gateway forwards all the requests to the Gateway API, who forwards them to the correct internal backend service within the Kubernetes controller.
Again: if you don’t use Kubernetes clusters, the topic of the gateway API is a mood point.