Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit ec5ac01

Browse files
author
Michelle Noorali
authored
Merge branch 'master' into target-no-rule
2 parents 2e52af4 + 7aca6b2 commit ec5ac01

File tree

7 files changed

+132
-20
lines changed

7 files changed

+132
-20
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515
- name: Setup Node.js
16-
uses: actions/setup-node@v1.1.0
16+
uses: actions/setup-node@v2-beta
17+
with:
18+
node-version: '12.x'
1719
- name: Run lint
1820
run: |
1921
make lint

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @grampelberg @lachie83 @leecalcote @nicholasjackson @slack @stefanprodan @michelleN @bridgetkromhout @ilevine
1+
* @grampelberg @lachie83 @leecalcote @nicholasjackson @slack @stefanprodan @michelleN @bridgetkromhout @ilevine @mhausenblas @pothulapati

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following documents are available:
3232
* **Flagger:** progressive delivery operator ([flagger.app](https://flagger.app))
3333
* **Istio\*:** connect, secure, control, observe ([servicemeshinterface/smi-adapter-istio](https://github.com/servicemeshinterface/smi-adapter-istio))
3434
* **Linkerd:** ultralight service mesh ([linkerd.io](https://linkerd.io))
35-
* **Maesh:** simpler service mesh ([mae.sh](https://mae.sh))
35+
* **Traefik Mesh:** simpler service mesh ([traefik.io/traefik-mesh](https://traefik.io/traefik-mesh))
3636
* **Meshery:** the service mesh management plane ([layer5.io/meshery](https://layer5.io/meshery))
3737
* **Rio:** application deployment engine ([rio.io](https://rio.io))
3838
* **Service Mesh Hub:** unified dashboard ([solo.io/products/service-mesh-hub](https://solo.io/products/service-mesh-hub))

apis/traffic-access/traffic-access-WD.md

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
**API Version:** v1alpha3-WD
66

7-
**Compatible With:** specs.smi-spec.io/v1alpha4-WD
7+
**Compatible with:** specs.smi-spec.io/v1alpha4-WD
8+
9+
## Specification
810

911
This set of resources allows users to define access control policy for their
1012
applications. It is the authorization side of the picture. Authentication should
@@ -13,8 +15,6 @@ already be handled by the underlying implementation and surfaced through a subje
1315
Access control in this specification is additive, all traffic is denied by default.
1416
See [tradeoffs](#tradeoffs) for a longer discussion about why.
1517

16-
## Specification
17-
1818
### TrafficTarget
1919

2020
A `TrafficTarget` associates a set of traffic definitions (rules) with a
@@ -43,6 +43,14 @@ To understand how this all fits together, first define the routes for some
4343
traffic.
4444

4545
```yaml
46+
kind: TCPRoute
47+
metadata:
48+
name: the-routes
49+
spec:
50+
matches:
51+
ports:
52+
- 8080
53+
---
4654
kind: HTTPRouteGroup
4755
metadata:
4856
name: the-routes
@@ -72,8 +80,9 @@ spec:
7280
kind: ServiceAccount
7381
name: service-a
7482
namespace: default
75-
port: 8080
7683
rules:
84+
- kind: TCPRoute
85+
name: the-routes
7786
- kind: HTTPRouteGroup
7887
name: the-routes
7988
matches:
@@ -88,8 +97,9 @@ This example selects all the pods which have the `service-a` `ServiceAccount`.
8897
Traffic destined on a path `/metrics` is allowed. The `matches` field is
8998
optional and if omitted, a rule is valid for all the matches in a traffic spec
9099
(a OR relationship). It is possible for a service to expose multiple ports,
91-
the `port` field allows the user to specify specifically which port traffic
92-
should be allowed on. `port` is an optional element, if not specified, traffic
100+
the TCPRoute/UDPRoute `matches.ports` field allows the user to specify
101+
specifically which port traffic should be allowed on.
102+
The `matches.ports` is an optional element, if not specified, traffic
93103
will be allowed to all ports on the destination service.
94104

95105
Allowing destination traffic should only be possible with permission of the
@@ -106,13 +116,21 @@ Source identities which are allowed to connect to the destination is defined in
106116
the sources list. Only pods which have a `ServiceAccount` which is named in
107117
the sources list are allowed to connect to the destination.
108118

109-
## Example Implementation
119+
## Example implementation for L7
110120

111121
The following implementation shows four services api, website, payment and
112122
prometheus. It shows how it is possible to write fine grained TrafficTargets
113123
which allow access to be controlled by route and source.
114124

115125
```yaml
126+
kind: TCPRoute
127+
metadata:
128+
name: api-service-port
129+
spec:
130+
matches:
131+
ports:
132+
- 8080
133+
---
116134
kind: HTTPRouteGroup
117135
metadata:
118136
name: api-service-routes
@@ -135,6 +153,8 @@ spec:
135153
name: api-service
136154
namespace: default
137155
rules:
156+
- kind: TCPRoute
157+
name: api-service-port
138158
- kind: HTTPRouteGroup
139159
name: api-service-routes
140160
matches:
@@ -153,8 +173,9 @@ spec:
153173
kind: ServiceAccount
154174
name: api-service
155175
namespace: default
156-
port: 8080
157176
rules:
177+
- kind: TCPRoute
178+
name: api-service-port
158179
- kind: HTTPRouteGroup
159180
name: api-service-routes
160181
matches:
@@ -176,6 +197,53 @@ The previous example would allow the following HTTP traffic:
176197
| payments-service | api-service | /api | * |
177198
| prometheus | api-service | /metrics | GET |
178199

200+
## Example implementation for L4
201+
202+
The following implementation shows how to define TrafficTargets for
203+
allowing TCP and UDP traffic to specific ports.
204+
205+
```yaml
206+
kind: TCPRoute
207+
metadata:
208+
name: tcp-ports
209+
spec:
210+
matches:
211+
ports:
212+
- 8301
213+
- 8302
214+
- 8300
215+
---
216+
kind: UDPRoute
217+
metadata:
218+
name: udp-ports
219+
spec:
220+
matches:
221+
ports:
222+
- 8301
223+
- 8302
224+
---
225+
kind: TrafficTarget
226+
metadata:
227+
name: protocal-specific
228+
spec:
229+
destination:
230+
kind: ServiceAccount
231+
name: server
232+
namespace: default
233+
rules:
234+
- kind: TCPRoute
235+
name: tcp-ports
236+
- kind: UDPRoute
237+
name: udp-ports
238+
sources:
239+
- kind: ServiceAccount
240+
name: client
241+
namespace: default
242+
```
243+
244+
Note that the above configuration will allow TCP and UDP traffic to
245+
both `8301` and `8302` ports, but will block UDP traffic to `8300`.
246+
179247
## Tradeoffs
180248

181249
* Additive policy - policy that denies instead of only allows is valuable

apis/traffic-metrics/traffic-metrics-WD.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**API Version:** v1alpha2-WD
66

7-
## Specfication
7+
## Specification
88

99
This specification describes a resource that provides a common integration
1010
point for tools that can benefit by consuming metrics related to HTTP traffic.
@@ -51,7 +51,7 @@ are two main ways to query the API for metrics:
5151
* A sub-resource allows querying for all the edges associated with a specific
5252
resource.
5353

54-
## Specification
54+
### TrafficMetrics
5555

5656
The core resource is `TrafficMetrics`. It references a `resource`, has an `edge`
5757
and surfaces latency percentiles and request volume.
@@ -441,7 +441,7 @@ targets pods with an Envoy sidecar and periodically requests
441441
rules and force integrations to query those directly. This feels like it
442442
increases the bar for metrics stores to change their internal configuration
443443
around to support this specification. There is also not a multi-tenant story
444-
for Prometheus series visibility that maps across Kuberenetes RBAC. From the
444+
for Prometheus series visibility that maps across Kubernetes RBAC. From the
445445
other side, consumers of these metrics will have to do discovery of
446446
Prometheus' location in the cluster and do some kind of queries to surface the
447447
data that they need.

apis/traffic-specs/traffic-specs-WD.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**API Group:** specs.smi-spec.io
44

5-
**Version:** v1alpha4-WD
5+
**API Version:** v1alpha4-WD
66

77
## Specification
88

@@ -137,14 +137,56 @@ to any path and all HTTP methods.
137137

138138
### TCPRoute
139139

140-
This resource is used to describe L4 TCP traffic. It is a simple route which configures
141-
an application to receive raw non protocol specific traffic.
140+
This resource is used to describe L4 TCP traffic for a list of ports.
142141

143142
```yaml
144143
kind: TCPRoute
145144
metadata:
146-
name: tcp-route
147-
spec: {}
145+
name: the-routes
146+
spec:
147+
matches:
148+
ports:
149+
- 3306
150+
- 6446
151+
```
152+
153+
When matching ports are not specified,
154+
the TCP route will match all the ports of a Kubernetes service:
155+
156+
```yaml
157+
kind: TCPRoute
158+
metadata:
159+
name: the-routes
160+
spec:
161+
matches:
162+
ports: []
163+
```
164+
165+
### UDPRoute
166+
167+
This resource is used to describe L4 UDP traffic for a list of ports.
168+
169+
```yaml
170+
kind: UDPRoute
171+
metadata:
172+
name: the-routes
173+
spec:
174+
matches:
175+
ports:
176+
- 989
177+
- 990
178+
```
179+
180+
When matching ports are not specified,
181+
the UDP route will match all the ports of a Kubernetes service:
182+
183+
```yaml
184+
kind: UDPRoute
185+
metadata:
186+
name: the-routes
187+
spec:
188+
matches:
189+
ports: []
148190
```
149191

150192
## Automatic Generation

apis/traffic-split/traffic-split-WD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**API Version:** v1alpha4-WD
66

7-
**Compatible with:** specs.smi-spec.io/v1alpha3
7+
**Compatible with:** specs.smi-spec.io/v1alpha4-WD
88

99
## Specification
1010

0 commit comments

Comments
 (0)