The Kubernetes Gateway API represents a massive collaborative effort and key advancement in Kubernetes networking. Developed by multiple vendors and community members, the Gateway API provides a robust and extensible new standard for managing ingress traffic. With the recent general availability of version 1.0.0, the Gateway API is now ready for production use.
The release of the Gateway API is a major milestone for Kubernetes networking that has the potential to simplify and enhance ingress management. In this blog post, we'll explore what the Gateway API is, how it improves upon the existing Ingress API, and how to get started with it.
## What is the Gateway API?
The Gateway API, originally proposed in 2019 at [San Diego KubeCon](https://www.youtube.com/watch?v=Ne9UJL6irXY&ab_channel=CNCF%5BCloudNativeComputingFoundation%5D)San Diego KubeCon, is the next generation of the Kubernetes Ingress API. It is designed to manage traffic from clients outside the cluster to services inside the cluster — the ingress or north/south case. However, the Gateway API is growing in popularity as a way to manage inter-service (east/west) traffic thanks to [GAMMA](https://gateway-api.sigs.k8s.io/concepts/gamma/)GAMMA, an experimental project that is being tried and tested by several implementations.
One of the main differences between the Gateway API and the Ingress API is the addition of routes, which are individual resources that are used to implement routing at both L4 and L7 layers. When a `*Route` is mentioned in the rest of this post, it refers to `HTTPRoute`, `TCPRoute` or any of the other available [Gateway API route resources](https://gateway-api.sigs.k8s.io/concepts/api-overview/#route-resources)Gateway API route resources.
The Gateway API contains many new resources. If you want to try it out, the minimum set of resources needed to create a Gateway API configuration, are:
- -
`Gateway` — the cluster access point - -
`GatewayClass` — describes the actual type of gateway controller that will handle traffic for the Gateway) - -
`*Route` — implement traffic routing from the Gateway to the backend services
## Why did we need the Gateway API?
The Ingress API lacks many features that would enable users to meet common routing requirements. Ingress API is not able to match based on query string parameters, or define L4 routing. The same goes for matching based on headers, or the HTTP method. This lack of off-the-shelf API features forced API implementations to create custom mechanisms on top of the API, such as annotations and decorators.
This led to the Ingress API annotation hell we live in today. You can learn the Ingress API, but that’s only 20% of what you need to know to be successful. Good luck if you want to try to migrate from one provider to another without re-learning everything. The Gateway API solves this problem.
In addition to core routing requirements, the Ingress API’s permissions model was insufficient for real-world use. The Gateway API significantly improved the [permission model](https://gateway-api.sigs.k8s.io/concepts/roles-and-personas/)permission model by introducing a new API layer (Routes), which isolates the tasks associated with various personas involved in managing the lifecycle of a cluster.
## How the Kong Ingress Controller improves the vanilla Ingress API
With the Ingress API not being purpose-built, implementers have to choose how to enable users to be successful. Kong Ingress Controller improves the Ingress API via [annotations](https://docs.konghq.com/kubernetes-ingress-controller/latest/references/annotations/)annotations and [custom extensions](https://docs.konghq.com/kubernetes-ingress-controller/latest/references/custom-resources/)custom extensions.
The `konghq.com/`-prefixed annotations enrich the Ingress semantics with all the possibilities and features that the Kong Gateway provides, such as header matching, method matching, and plugin attachment.
In addition to annotations, the Kong Ingress Controller provides new CRDs to allow users to expose not only L7, but also L4 services. `TCPIngresses` allow the routing of TCP and TLS services, while `UDPIngresses` are for UDP traffic. These resources are very similar to the regular Ingress, but due to the lack of defined upstream standards, they have been implemented as vendor-specific resources.
Furthermore, `KongIngress` is provided as an Ingress decorator, which allows specifying [upstream](https://docs.konghq.com/gateway/latest/admin-api/#upstream-object)upstream capabilities on top of backend services. A common example of this is controlling how incoming requests should be load-balanced over multiple services.
## How the Gateway API improved the Ingress API
The Gateway API improved the Ingress API in many different aspects. The first one is the introduction of the Routes as separate APIs. Here is a diagram of how Ingress and Gateway API differ in terms of APIs and interconnections.
### Ingress API