Skip to content

Commit

Permalink
docs: update tcp guide for v1alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneutt committed Aug 23, 2021
1 parent b4a9dc4 commit d7f1073
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
45 changes: 45 additions & 0 deletions examples/v1alpha2/basic-tcp.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 2 additions & 6 deletions site-src/v1alpha2/guides/tcp.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand All @@ -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' %}
```

0 comments on commit d7f1073

Please sign in to comment.