liveBook · Manning

Chapter 13: Routing traffic using the Gateway API

What you will learn in chapter 13 of Kubernetes in Action, Second Edition

Introduces the Gateway API as a broader alternative to Ingress for exposing Kubernetes Services externally.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces the Gateway API as a broader alternative to Ingress for exposing Kubernetes Services externally.

Key terms: Ingress API, Gateway API, gateway proxies, L7, L4

13.1 Introducing the Gateway API

Introduces the Gateway API as Kubernetes resources for routing external traffic through a gateway proxy to Services.

Key terms: Gateway API, gateway proxy, ClusterIP Services, NodePort, LoadBalancer

13.1.1 Comparing Gateway API to Ingress

This section compares Ingress with the Gateway API and explains the benefits of separating gateways from routes.

Key terms: Ingress, IngressClass, Gateway, GatewayClass, Route, Route objects, TLS, gRPC, TCP, namespaces

13.1.2 Understanding the Gateway API implementation

This section explains why the Gateway API needs a separate provider and how release channels and support levels affect API stability and portability.

Key terms: Gateway API, Gateway API provider, implementation, Custom Resource Definitions (CRDs), standard channel, experimental channel, support level, core features, extended features, implementation-specific features

13.1.3 Deploying Istio as the Gateway API provider

Explains how to prepare a cluster for Gateway API by installing its resource definitions and a provider that manages those resources.

Key terms: Gateway API Custom Resource Definitions, CRDs, experimental channel, kubectl apply -k, Kustomize, kustomization.yaml, patches, controller, Gateway API provider, Istio

13.2 Deploying a Gateway

This introduction establishes that a Gateway object must specify a Gateway class and that a cluster may offer more than one class.

Key terms: Gateway class, Gateway object

13.2.1 Understanding Gateway classes

Explains what GatewayClass objects represent, what their definitions specify, and why each Gateway must name a class.

Key terms: GatewayClass, Gateway, controllerName, Istio, parameters

13.2.2 Creating a Gateway object

Shows how to define and create a Gateway, then inspect the externally reachable proxy resources Istio creates for it.

Key terms: Gateway, gatewayClassName, GatewayClass, listener, addresses, kubectl apply, kubectl get, ADDRESS, gtw, LoadBalancer Service

13.2.3 Exploring the Gateway’s status

This section shows how to read a Gateway’s status to find its reachable addresses, assess its conditions, and diagnose listener problems.

Key terms: status.addresses, spec.addresses, IPAddress, Hostname, conditions, type, status, reason, message, Programmed

13.3 Exposing HTTP services using HTTPRoute

This section identifies HTTPRoute as the common Gateway API route kind for connecting an HTTP Service to one or more gateways.

Key terms: Gateway API, Route object, HTTPRoute, HTTP Service, gateway

13.3.1 Creating a simple HTTPRoute

This section creates a basic HTTPRoute, explains the defaults visible in its spec, and shows how its status helps diagnose routing problems.

Key terms: HTTPRoute, parentRefs, backendRefs, Gateway, Service, hostname, spec, weight, matches, status

13.3.2 Splitting traffic between multiple backends

This section shows how to split HTTPRoute traffic between stable and canary Services using weighted backends.

Key terms: HTTPRoute, backendRefs, weight, Service, kiada Service, kiada-new Pod, kiada-new Service, kiada-stable Service, endpoints, canary Service

13.3.3 Routing HTTP requests to different backends

This section explains how an HTTPRoute sends requests to different backend services by matching data in each HTTP request.

Key terms: HTTPRoute, matches, catch-all rule, backend service, method, headers, path, queryParams, Exact, PathPrefix

13.3.4 Augmenting HTTP traffic with filters

Explains how HTTPRoute filters modify HTTP traffic, redirect requests, mirror them to another service, and use implementation-specific extensions.

Key terms: RequestHeaderModifier, responseHeaderModifier, add, set, remove, URLRewrite, ReplaceFullPath, ReplacePrefixMatch, matched prefix, RequestRedirect

13.4 Configuring a gateway for TLS

Introduces the two ways a Gateway can handle TLS and explains how each affects what the gateway can see.

Key terms: TLS termination, TLS pass-through, backend, Server Name Identification (SNI)

13.4.1 Terminating TLS sessions at the gateway

Explains how to terminate HTTPS at a Gateway, route the resulting HTTP traffic with an HTTPRoute, and recognize that traffic to the backend is then unencrypted.

Key terms: Gateway listener, tls.mode, Terminate, certificateRefs, Secret, HTTPRoute, TLS termination, backend service, tls.options, minimum TLS version

13.4.2 End-to-end encryption using TLSRoutes and pass-through TLS

This section shows how to pass encrypted traffic through a Gateway to a pod and route it with a TLSRoute.

Key terms: TLS pass-through, Envoy sidecar, loopback device, listener, tls.mode, Passthrough, TLS, TLSRoute, HTTPRoute, Server Name Identification (SNI)

13.5 Exposing other types of services

This section introduces Gateway API route resources for TCP, UDP, and gRPC services and prepares a test service for the following examples.

Key terms: Gateway API, Ingress API, TCPRoute, UDPRoute, GRPCRoute

13.5.1 Exposing a TCP service with a TCPRoute

This section shows how a TCP listener and TCPRoute expose a backend Service through a gateway, and explains the limits of TCP routing.

Key terms: TCP listener, TCPRoute, Gateway, backend service, backends, weight, content-aware routing

13.5.2 UDPRoute

This subsection shows how to expose a UDP service with a gateway listener and UDPRoute, then how to recognize that the example implementation has not processed the route.

Key terms: UDP listener, UDPRoute, Gateway, backend service, status, controller, Istio

13.5.3 GRPCRoute

This section shows how a GRPCRoute directs gRPC calls through a Gateway and briefly describes its matching rules, filters, and implementation support.

Key terms: GRPCRoute, gRPC listener, Gateway, Service, matches, gRPC request headers, method, Exact, RegularExpression, filters

13.6 Using Gateway API resources across namespaces

This section introduces the permission requirement for routes that reference gateways or backend services across namespaces.

Key terms: route, gateway, backend service, namespace, explicit permission

13.6.1 Sharing a gateway across namespaces

Explains how a Gateway can accept routes from other namespaces and how a route references that Gateway.

Key terms: listener, allowedRoutes.namespaces, Same, All, Selector, parentRefs, namespace, HTTPRoute, TCPRoute, part-of=kiada

13.6.2 Routing to a service in a different namespace

This subsection explains how a ReferenceGrant permits an HTTPRoute to use a Service backend in another namespace and how to verify that the reference is allowed.

Key terms: ReferenceGrant, referent, HTTPRoute, Service, from, to, ResolvedRefs

13.7 From ingress gateways to service mesh

The section explains how the Gateway API extends from exposing services to outside clients to configuring service-to-service traffic in a service mesh.

Key terms: north/south traffic, east/west traffic, service mesh, Service Mesh Interface (SMI), Gateway API Mesh Management and Administration (GAMMA), HTTPRoute, parentRefs, group, kind, Service

13.8 Summary

Summarizes how the Gateway API exposes services through gateways and routes HTTP, TLS, gRPC, TCP, and UDP traffic.

Where this is used later

Concepts explained in this chapter

← Chapter 12: Using Ingress to route traffic to services Chapter 14: Scaling and maintaining pods with ReplicaSets →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.