A TLSRoute is a Kubernetes Gateway API resource for routing encrypted TLS traffic to backend services. With pass-through TLS, the gateway cannot inspect HTTP details; it primarily uses the recipient hostname. section 13.4.2
Use a TLSRoute when TLS remains encrypted from the client to the backend. Configure the Gateway listener with protocol TLS and tls.mode Passthrough; unlike HTTPS termination, the gateway does not know the underlying application protocol. section 13.4.2
Route a hostname to a TLS backend
A TLSRoute can attach to the kiada Gateway, match kiada.example.com, and forward traffic to the kiada-stable Service on port 443. Its essential fields are parentRefs, hostnames, and backendRefs. section 13.4.2
Listing 13.16 Configuring a gateway for TLS pass-through
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: kiada
spec:
gatewayClassName: istio
listeners:
- name: http
port: 80
protocol: HTTP
- name: tls #1
port: 443 #2
protocol: TLS #3
tls: #4
mode: Passthrough #4
Inspect the Gateway listener required before applying a TLSRoute: port 443 uses protocol TLS and Passthrough mode. section 13.4.2
Listing 13.17 Creating a TLSRoute
apiVersion: gateway.networking.k8s.io/v1alpha2 #1
kind: TLSRoute #1
metadata:
name: kiada
spec:
parentRefs: #2
- name: kiada #2
hostnames: #3
- kiada.example.com #3
rules: #4
- backendRefs: #5
- name: kiada-stable #5
port: 443 #5
Inspect a complete TLSRoute manifest showing the v1alpha2 API, parent Gateway, hostname match, and backend reference. section 13.4.2
