Skip to content

Commit

Permalink
docs(madr): make api more consistent with GAPI
Browse files Browse the repository at this point in the history
Signed-off-by: Bart Smykla <bartek@smykla.com>
  • Loading branch information
bartsmykla committed May 11, 2023
1 parent 5262b83 commit 2f31cab
Showing 1 changed file with 36 additions and 16 deletions.
52 changes: 36 additions & 16 deletions docs/madr/decisions/026-mesh-tcp-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ Policy should allow to

Chosen option: Create a `MeshTCPRoute` policy

### `spec.to[].rules`

At this point there is no plan to introduce address matching capabilities for
`MeshTCPRoute` in foreseeable future. We try to be as close with structures of
our policies to the Gateway API as possible. It means, that even if Gateway API
currently doesn't have plans to support this kind of matching as well (ref.
[Kubernetes Gateway API GEP-735: TCP and UDP addresses matching](https://gateway-api.sigs.k8s.io/geps/gep-735/)),
its structures are ready to potentially support it.

As a result every element of the route destination section of the policy
configuration (`spec.to[]`) contains a `rules` property. This property is a list
of elements, which potentially will allow to specify `match` configuration.

Implementation of the `MeshTCPRoute` which should be a result of this document,
should validate that this list will contain only one element. This is due
to the fact, that without specifying `match`es, it would be nonsensical to
accept more `rules.`

### Traffic Rerouting

If `matches` succeeds, the request is routed to the specified destinations
Expand All @@ -70,10 +88,11 @@ spec:
- targetRef:
kind: MeshService
name: tcp-backend
default:
backendRefs:
- kind: MeshService
name: tcp-other-backend
rules:
- default:
backendRefs:
- kind: MeshService
name: tcp-other-backend
```

### Traffic Split
Expand All @@ -91,16 +110,17 @@ spec:
- targetRef:
kind: MeshService
name: tcp-backend
default:
backendRefs:
- weight: 90
kind: MeshServiceSubset
name: tcp-backend
tags:
version: v2
- weight: 10
kind: MeshServiceSubset
name: tcp-backend
tags:
version: v2
rules:
- default:
backendRefs:
- weight: 90
kind: MeshServiceSubset
name: tcp-backend
tags:
version: v2
- weight: 10
kind: MeshServiceSubset
name: tcp-backend
tags:
version: v2
```

0 comments on commit 2f31cab

Please sign in to comment.