From d7f107355b19e539b899e1c71dd704b6278d2ac3 Mon Sep 17 00:00:00 2001 From: Shane Utt Date: Mon, 23 Aug 2021 10:35:45 -0400 Subject: [PATCH] docs: update tcp guide for v1alpha2 --- examples/v1alpha2/basic-tcp.yaml | 45 ++++++++++++++++++++++++++++++++ site-src/v1alpha2/guides/tcp.md | 8 ++---- 2 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 examples/v1alpha2/basic-tcp.yaml diff --git a/examples/v1alpha2/basic-tcp.yaml b/examples/v1alpha2/basic-tcp.yaml new file mode 100644 index 0000000000..88de2884df --- /dev/null +++ b/examples/v1alpha2/basic-tcp.yaml @@ -0,0 +1,45 @@ +kind: Gateway +apiVersion: gateway.networking.k8s.io/v1alpha2 +metadata: + name: my-tcp-gateway +spec: + gatewayClassName: my-tcp-gateway-class + listeners: + - name: foo + protocol: TCP + port: 8080 + routes: + kinds: + - kind: TCPRoute + - name: bar + protocol: TCP + port: 8090 + routes: + kinds: + - kind: TCPRoute +--- +kind: TCPRoute +apiVersion: gateway.networking.k8s.io/v1alpha2 +metadata: + name: tcp-app-1 +spec: + parentRefs: + - name: my-tcp-gateway + sectionName: foo + rules: + - backendRefs: + - name: my-foo-service + port: 6000 +--- +kind: TCPRoute +apiVersion: gateway.networking.k8s.io/v1alpha2 +metadata: + name: tcp-app-2 +spec: + parentRefs: + - name: my-tcp-gateway + sectionName: bar + rules: + - backendRefs: + - name: my-bar-service + port: 6000 diff --git a/site-src/v1alpha2/guides/tcp.md b/site-src/v1alpha2/guides/tcp.md index 96f6032f4f..7b7700fbd5 100644 --- a/site-src/v1alpha2/guides/tcp.md +++ b/site-src/v1alpha2/guides/tcp.md @@ -1,7 +1,3 @@ - -!!! danger - This page has not been updated for v1alpha2 yet. - Gateway API is designed to work with multiple protocols. [TCPRoute](/v1alpha2/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.TCPRoute) is one such route which allows for managing TCP traffic. @@ -17,7 +13,7 @@ distribute the traffic with the following rules: Please note the following: - The `protocol` of listeners on the Gateway is `TCP`. -- Each listener selects exactly one TCPRoute. This is important since the routing +- Each `TCPRoute` selects exactly one listener. This is important since the routing decision is performed based on destination port only. If more metadata is used for routing decisions, then one may associate multiple TCPRoutes to a single Gateway listener. Implementations can support such use-cases by adding a custom @@ -26,5 +22,5 @@ Please note the following: be resolved as per the [conflict resolution](/v1alpha2/concepts/guidelines#conflicts) guidelines. ``` -{% include 'v1alpha1/basic-tcp.yaml' %} +{% include 'v1alpha2/basic-tcp.yaml' %} ```