liveBook · Manning

HTTPRoute

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

An HTTPRoute is a Gateway API resource that defines HTTP host, path, and backend routing rules for application traffic.

HTTPRoute defines application-level HTTP routing in the Gateway API. Application developers attach it to a Gateway, then specify hostnames, path matches, and backend Services; infrastructure teams separately manage GatewayClass and Gateway resources. section 6.7

Route a hostname to a Service

apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: example-httproute spec: parentRefs: - name: example-gateway hostnames: - "www.example.com" rules: - matches: - path: type: PathPrefix value: / backendRefs: - name: nginx port: 8080 Apply the manifest with kubectl, then verify the resource with kubectl get httproute.

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

How deep it goes
Demonstrates hostname, path-prefix, parent-Gateway, backend-Service, and port configuration, then verifies creation with kubectl.
Examples
Uses www.example.com with a root PathPrefix to route traffic to the nginx Service on port 8080.
What it assumes
Assumes Gateway API context and a Gateway, while distinguishing application routing from GatewayClass infrastructure configuration.
What you can do after
Build it from scratch with a v1 manifest, attach it to a Gateway, route a hostname, and verify the resulting resource.
How it connects
Connects HTTPRoute with Gateway API, Gateway, GatewayClass, Ingress, TCPRoute, and Service resources.

Also explained in

Compare how 2 books explain HTTPRoute →

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.