liveBook · Manning

Gateway object

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

A Gateway is a namespace-scoped Gateway API resource that defines listeners and the protocols, ports, and gateway class used for traffic entry.

A Gateway is a namespace-scoped Gateway API resource that defines traffic-entry listeners, including the gateway class, protocols, and ports. It gives cluster operators control over operational concerns such as TLS certificates while application developers configure routing separately with Route resources. section 6.7

Use the Gateway API model to divide traffic-management responsibilities:

  • Infrastructure providers manage cluster-scoped GatewayClass resources and the underlying infrastructure, such as external load balancers. section 6.7
  • Cluster operators configure Gateway resources, including listeners, TLS certificates, ports, and protocols. section 6.7
  • Application developers attach Route resources such as HTTPRoute or TCPRoute to describe application-level traffic direction. section 6.7

Create an HTTP listener

Apply a Gateway in the default namespace with gatewayClassName set to example-class and an HTTP listener on port 80. Verify creation with kubectl; then attach an HTTPRoute through parentRefs to route requests to a backend Service. section 6.7

$ cat <<EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: example-gateway
  namespace: default
spec:
  gatewayClassName: example-class
  listeners:
  - name: http
    protocol: HTTP
    port: 80
EOF
gateway.gateway.networking.k8s.io/example-gateway created

Shows a complete Gateway manifest with its namespace, GatewayClass reference, HTTP listener, and kubectl creation output. section 6.7

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

How deep it goes
Defines Gateway scope, listeners, protocols, ports, and responsibilities, but defers controller installation and implementation internals.
Examples
Uses an example HTTP listener on port 80 and an HTTPRoute that matches a hostname and path.
What it assumes
Assumes familiarity with Kubernetes Services and ingress while introducing GatewayClass, Gateway, and HTTPRoute as a separate model.
What you can do after
Operate/configure a Gateway and verify its creation before attaching application routes.
How it connects
Connects GatewayClass with HTTPRoute, TCPRoute, ingress, load balancers, TLS termination, and traffic management.

Also explained in

Compare how 2 books explain gateway object →

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.