liveBook · Manning

Gatewayclass

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A GatewayClass is a cluster-scoped Gateway API resource that defines the controller responsible for implementing a class of gateways.

A GatewayClass is a cluster-scoped Gateway API resource that identifies the controller responsible for implementing a class of gateways. It defines controller ownership, not traffic patterns or routes. section 6.7

Use GatewayClass to:

  • Select the controller with the single required spec.controllerName value, such as example.com/gateway-controller. section 6.7
  • Support multiple gateway controllers, such as nginx and Contour, in one cluster by defining separate classes. section 6.7
  • Connect a namespaced Gateway through spec.gatewayClassName; configure listeners and routing separately on Gateway and HTTPRoute resources. section 6.7

Create a GatewayClass

Apply a v1 GatewayClass named example-class with controllerName example.com/gateway-controller. The resulting object can be selected by a Gateway using gatewayClassName: example-class. section 6.7

$ cat <<EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: example-class
spec:
  controllerName: example.com/gateway-controller
EOF
gatewayclass.gateway.networking.k8s.io/example-class created

Inspect the complete kubectl manifest and representative creation output for a GatewayClass. section 6.7

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Defines cluster scope and controllerName, stopping short of listener, hostname, backend, or traffic-route configuration.
Examples
Uses example-class with controllerName example.com/gateway-controller and demonstrates selection from a Gateway resource.
What it assumes
Assumes Gateway API CRDs are installed or provided, while teaching the three core objects needed for exam configuration.
What you can do after
Operate/configure a Gateway API controller class and associate Gateways with the correct implementation.
How it connects
Connects Gateway controllers with Gateway, HTTPRoute, TCPRoute, and Ingress concepts for Kubernetes traffic management.

Also explained in

Compare how 2 books explain gatewayclass →

Related concepts

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