liveBook · Manning

Gatewayclass

As explained in Kubernetes in Action, Second Edition

A GatewayClass is a Kubernetes Gateway API resource that defines a class of gateways managed by a particular controller and optionally associated parameters.

A GatewayClass identifies a class of Kubernetes Gateway resources managed by a particular controller. A cluster can provide one or more classes, allowing each Gateway to choose its provider. section 13.2.1 section 13.8

A GatewayClass connects Gateway configuration to the implementation that provisions it:

  • Its spec includes a controllerName identifying the controller that manages Gateways of that class. section 13.2.1
  • It can include a reference to additional parameters used by the controller when creating Gateways. section 13.2.1
  • When several classes exist, they typically point to different controllers or parameter objects. section 13.2.1
  • Every Gateway must reference a class through its gatewayClassName field. section 13.2.1 section 13.2.2

Selecting the Istio GatewayClass

A Gateway manifest can select the Istio class with gatewayClassName: istio. Applying it creates the Gateway; the responsible controller can assign an address and create a LoadBalancer Service backing the gateway. section 13.2.2 section 13.2.2

$ kubectl get gatewayclasses
NAME    CONTROLLER                    ACCEPTED   AGE
istio   istio.io/gateway-controller   True       2m      #1

List the GatewayClasses available in a cluster and inspect their acceptance status, controller, and age. section 13.2.1

$ kubectl get gatewayclass istio -o yaml
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
...
spec:
  controllerName: istio.io/gateway-controller    #1
  description: The default Istio GatewayClass     #2

Inspect a GatewayClass manifest to see its controllerName and optional descriptive or parameter-related configuration. section 13.2.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains controllerName, optional parameters, and Gateway references, but stops short of detailing GatewayClass creation.
Examples
Uses kubectl listings, Istio's istio class, and a Gateway manifest with gatewayClassName: istio.
What it assumes
Requires a Gateway API implementation installed in the cluster; Kubernetes does not provide one by default.
What you can do after
Operate/configure Gateways by listing available classes and setting gatewayClassName to the intended provider.
How it connects
Connects GatewayClass with Gateway, controllers, IngressClass, HTTPRoute, and LoadBalancer Service.

Also explained in

Compare how 2 books explain gatewayclass →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.