# Exhaustive TCPRoute reference (gateway.networking.k8s.io/v1alpha2). # Routes raw TCP (SSH, databases, any non-HTTP protocol) from a TCP listener # to backends. No hostname/path matching exists at this layer - there is # nothing but the destination port to route on. For TLS with SNI-based # routing see TLSRoute; for HTTP see HTTPRoute. apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TCPRoute metadata: name: app-ssh namespace: example labels: app: app spec: parentRefs: # Bind to the TCP listener of the Gateway. Same fields as HTTPRoute # parentRefs: name/kind/group plus sectionName and/or port narrowing. - name: example kind: Gateway group: gateway.networking.k8s.io sectionName: tcp port: 2222 rules: - backendRefs: - name: app-service # port: backend Service port. Required. port: 2222 kind: Service group: "" # weight: share of connections when several backends are listed. weight: 1 # Second backend: every new connection goes 3:1 here. Weights are # the only traffic-shaping knob TCP routing has. - name: app-replica-service port: 2222 weight: 3