Skip to main content
RunBook Academy

KubernetesXLIII · Gateway APIGateway API

Other route types — TCPRoute, UDPRoute, TLSRoute, GRPCRoute

Advanced⏱ ~15 minkubectl

What you'll learn

  • Identify the four other route types (TCPRoute, UDPRoute, TLSRoute, GRPCRoute)
  • Configure each route type for the workload
  • Identify the use cases for each route type
  • Identify the failure modes of each route type

Prerequisites

Verified against Kubernetes 1.34.x · kubeadm 1.34.x · kubectl 1.34.x · etcd 3.6.x · CoreDNS 1.11.x · containerd 1.7.x / 2.x · 2026-08-16

Not yet marked complete on this device.

The Gateway API supports four other route types: TCPRoute, UDPRoute, TLSRoute, and GRPCRoute. The route types enable the Gateway to serve non-HTTP traffic. This lesson walks the route types, the use cases, and the operational discipline.

The four route types

The four route types:

Route TypeProtocolUse Case
TCPRouteTCPDatabases, message brokers
UDPRouteUDPDNS, syslog, video streaming
TLSRouteTLSTLS passthrough
GRPCRoutegRPCgRPC services

The route types are the Gateway API’s coverage of the common protocols.

TCPRoute

The TCPRoute is the resource for Layer 4 TCP traffic:

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
  name: postgres
  namespace: prod-app
spec:
  parentRefs:
    - name: prod-gateway
      sectionName: tcp
  rules:
    - backendRefs:
        - name: postgres
          port: 5432

The TCPRoute forwards TCP traffic to the backend Service. The use cases are databases, message brokers, and other TCP services.

flowchart LR
    A[External client] -->|TCP 5432| B[Gateway listener]
    B -->|TCP 5432| C[postgres:5432]

The TCPRoute is a simple forwarding rule.

UDPRoute

The UDPRoute is the resource for Layer 4 UDP traffic:

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: UDPRoute
metadata:
  name: dns
  namespace: prod-app
spec:
  parentRefs:
    - name: prod-gateway
      sectionName: udp
  rules:
    - backendRefs:
        - name: dns
          port: 53

The UDPRoute forwards UDP traffic to the backend Service. The use cases are DNS, syslog, video streaming, and other UDP services.

TLSRoute

The TLSRoute is the resource for TLS passthrough:

apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TLSRoute
metadata:
  name: tls-passthrough
  namespace: prod-app
spec:
  parentRefs:
    - name: prod-gateway
      sectionName: tls
  hostnames:
    - billing.example.com
  rules:
    - backendRefs:
        - name: billing
          port: 443

The TLSRoute forwards TLS traffic to the backend Service. The backend terminates TLS. The use cases are TLS services that need to terminate TLS at the backend.

GRPCRoute

The GRPCRoute is the resource for gRPC traffic:

apiVersion: gateway.networking.k8s.io/v1
kind: GRPCRoute
metadata:
  name: grpc-billing
  namespace: prod-app
spec:
  parentRefs:
    - name: prod-gateway
      sectionName: grpc
  hostnames:
    - billing.example.com
  rules:
    - matches:
        - method:
            service: billing.BillingService
            method: Get
      backendRefs:
        - name: billing
          port: 50051

The GRPCRoute routes gRPC traffic based on the service and method. The use cases are gRPC services that need fine-grained routing.

The failure modes

The route types’ failure modes:

  • parentRefs missing: the parentRefs is missing or wrong. The fix is to verify the parentRefs.
  • Backend not ready: the backend Service has no Pods. The fix is to verify the backend.
  • TLS error: the TLS configuration is wrong. The fix is to verify the TLS configuration.
  • Route not supported: the controller does not support the route type. The fix is to verify the controller’s support.

The operational discipline

The route types’ operational discipline:

  • Document the route types. The route types are the cluster’s HTTP gateway configuration.
  • Audit the route types at every change. The route types are critical configuration.
  • Test the route types in staging. The route types must work for the workload.
  • Monitor the route types’ status. The status is the leading indicator.
  • Plan the route types’ evolution. The route types can be replaced with a new controller.
  • Document the troubleshooting. The troubleshooting is the cluster’s operational reference.

Quiz

Knowledge check · 4 questions

  1. Q1. Which Route type is the Gateway API's answer to LoadBalancer for TCP traffic?

  2. Q2. The GRPCRoute routes gRPC traffic based on the service and method.

  3. Q3. A TCPRoute is not bound to the Gateway. The backend Service has no Pods. What is the diagnostic flow and the recovery?

    The cluster has a TCPRoute postgres referencing the Gateway prod-gateway. The backend Service has no Pods. The TCPRoute is not bound. The cluster operator must investigate.

  4. Q4. Name two Gateway API route types and the use case for each.

Passing score: 75%. Answers are checked in this browser.

Production discipline

  • The route types are the Gateway API’s coverage of the common protocols. The cluster operator must choose the right route type for the workload.
  • Document the route types. The route types are the cluster’s HTTP gateway configuration.
  • Audit the route types at every change. The route types are critical configuration.
  • Test the route types in staging. The route types must work for the workload.
  • Monitor the route types’ status. The status is the leading indicator.
  • Plan the route types’ evolution. The route types can be replaced with a new controller.
  • Document the troubleshooting. The troubleshooting is the cluster’s operational reference.
  • Train the teams on the route types. The teams must understand the route types’ use cases.
  • Document the route types’ design. The route types are the cluster’s HTTP gateway; the documentation is the reference.