⎈ k8s knowledge compiler

Gateway API [page]deterministic

Gateway API is a family of API kinds that provide dynamic infrastructure provisioning and advanced traffic routing.

concepts

Make network services available by using an extensible, role-oriented, protocol-aware configuration mechanism. [Gateway API](https://gateway-api.sigs.k8s.io/) is an [add-on](#gloss:addons) containing API [kinds](https://gateway-api.sigs.k8s.io/references/spec/) that provide dynamic infrastructure provisioning and advanced traffic routing.

## Design principles

The following principles shaped the design and architecture of Gateway API:

* __Role-oriented:__ Gateway API kinds are modeled after organizational roles that are responsible for managing Kubernetes service networking: * __Infrastructure Provider:__ Manages infrastructure that allows multiple isolated clusters to serve multiple tenants, e.g. a cloud provider. * __Cluster Operator:__ Manages clusters and is typically concerned with policies, network access, application permissions, etc. * __Application Developer:__ Manages an application running in a cluster and is typically concerned with application-level configuration and [Service](/docs/concepts/services-networking/service/) composition. * __Portable:__ Gateway API specifications are defined as [custom resources](/docs/concepts/extend-kubernetes/api-extension/custom-resources) and are supported by many [implementations](https://gateway-api.sigs.k8s.io/implementations/). * __Expressive:__ Gateway API kinds support functionality for common traffic routing use cases such as header-based matching, traffic weighting, and others that were only possible in [Ingress](/docs/concepts/services-networking/ingress/) by using custom annotations. * __Extensible:__ Gateway allows for custom resources to be linked at various layers of the API. This makes granular customization possible at the appropriate places within the API structure.

## Resource model

Gateway API has four stable API kinds:

* __GatewayClass:__ Defines a set of gateways with common configuration and managed by a controller that implements the class.

* __Gateway:__ Defines an instance of traffic handling infrastructure, such as cloud load balancer.

* __HTTPRoute:__ Defines HTTP-specific rules for mapping traffic from a Gateway listener to a representation of backend network endpoints. These endpoints are often represented as a [Service](#gloss:service).

* __GRPCRoute:__ Defines gRPC-specific rules for mapping traffic from a Gateway listener to a representation of backend network endpoints. These endpoints are often represented as a [Service](#gloss:service).

Gateway API is organized into different API kinds that have interdependent relationships to support the role-oriented nature of organizations. A Gateway object is associated with exactly one GatewayClass; the GatewayClass describes the gateway controller responsible for managing Gateways of this class. One or more route kinds such as HTTPRoute, are then associated to Gateways. A Gateway can filter the routes that may be attached to its `listeners`, forming a bidirectional trust model with routes.

The following figure illustrates the relationships of the three stable Gateway API kinds:

![A figure illustrating the relationships of the three stable Gateway API kinds](/docs/images/gateway-kind-relationships.svg)

### GatewayClass {#api-kind-gateway-class}

Gateways can be implemented by different controllers, often with different configurations. A Gateway must reference a GatewayClass that contains the name of the controller that implements the class.

A minimal GatewayClass example:

```yaml apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: example-class spec: controllerName: example.com/gateway-controller ```

In this example, a controller that has implemented Gateway API is configured to manage GatewayClasses with the controller name `example.com/gateway-controller`. Gateways of this class will be managed by the implementation's controller.

See the [GatewayClass](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networkin …(trimmed)

Sources

concepts/services-networking/gateway.md · docGateway API

Related (12)

references Add-onsadd-on conf=1
references ServiceService conf=1
part_of Design principlesdescribes conf=1
part_of Resource modeldescribes conf=1
part_of Request flowdescribes conf=1
part_of Conformancedescribes conf=1
part_of Migrating from Ingressdescribes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1
part_of GatewayClass {#api-kind-gateway-class}describes conf=1
part_of Gateway {#api-kind-gateway}describes conf=1
part_of HTTPRoute {#api-kind-httproute}describes conf=1
part_of GRPCRoute {#api-kind-grpcroute}describes conf=1

← all Docs