OpenMCF logoOpenMCF

Loading...

Kubernetes TLS Route

Provision a Kubernetes Gateway API TLSRoute -- namespaced TLS passthrough rules that attach to a Gateway and forward connections, by SNI hostname, to backend Services. The backend terminates TLS, so the encrypted stream is forwarded end to end (the Gateway never sees plaintext).

What Gets Created

  • A namespaced gateway.networking.k8s.io/v1 TLSRoute custom resource.
  • Exactly one rule that forwards to one or more weighted backend refs.

Prerequisites

  • Gateway API CRDs installed on the cluster (KubernetesGatewayApiCrds).
  • A Gateway to attach to via parentRefs (KubernetesGateway) with a TLS listener (typically tls.mode: Passthrough).
  • The target namespace (KubernetesNamespace).
  • The backend Services the route forwards to.

Quick Start

apiVersion: kubernetes.openmcf.org/v1
kind: KubernetesTlsRoute
metadata:
  name: secure-route
spec:
  namespace:
    value: app-ns
  parentRefs:
    - name: my-gateway
      sectionName: tls
  hostnames:
    - secure.example.com
  rules:
    - backendRefs:
        - name: secure-backend
          port: 8443
openmcf apply -f tlsroute.yaml

Configuration Reference

Required Fields

FieldTypeDescription
namespacereferenceNamespace to create the route in.
hostnameslistOne to 16 SNI hostnames that select this route (no IPs).
ruleslistExactly one routing rule.

Optional Fields

FieldTypeDescription
parentRefslistGateways (and optional listener sectionName) the route attaches to.
rules[].namestringOptional rule name.
rules[].backendRefslistWeighted backends to forward to.

Examples

TLS passthrough by SNI

spec:
  namespace:
    value: app-ns
  parentRefs:
    - name: my-gateway
      sectionName: tls
  hostnames:
    - secure.example.com
  rules:
    - backendRefs:
        - name: secure-backend
          port: 8443

Weighted backends (canary)

spec:
  namespace:
    value: app-ns
  parentRefs:
    - name: my-gateway
      sectionName: tls
  hostnames:
    - secure.example.com
  rules:
    - backendRefs:
        - name: secure-stable
          port: 8443
          weight: 90
        - name: secure-canary
          port: 8443
          weight: 10

Stack Outputs

OutputDescription
routeNameName of the created TLSRoute (equals metadata.name).
namespaceNamespace the TLSRoute was created in.

Related Components

  • Kubernetes Gateway
  • Kubernetes HTTP Route
  • Kubernetes Gateway Class
  • Kubernetes Gateway API CRDs
  • Kubernetes Namespace

Next article

Kubernetes Zalando Postgres Operator

Kubernetes Zalando Postgres Operator Deploys the Zalando Postgres Operator on a Kubernetes cluster using its official Helm chart (v1.12.2). The operator installs the control-plane components that watch for postgresql custom resources, enabling declarative PostgreSQL cluster lifecycle management including automated patroni-based failover, rolling updates, and optional WAL-G backups to Cloudflare R2-compatible object storage. What Gets Created When you deploy a KubernetesZalandoPostgresOperator...
Read next article
Presets
2 ready-to-deploy configurationsView presets →