Skip to content

Commit 70010a5

Browse files
committed
docs(api): clean up gw api syntax proposal
Signed-off-by: Sergei Lukianov <[email protected]>
1 parent f7efaf9 commit 70010a5

File tree

1 file changed

+75
-96
lines changed

1 file changed

+75
-96
lines changed

docs/proposed-api.md

+75-96
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ be based on flow state. How does this interact with other configuration?
3333

3434
### VPC1 <> VPC2 with overlapping subnets
3535

36+
- vpc-1 with a single subnet 10.1.1.0/24 named subnet-1
37+
- vpc-2 with a the same subnet 10.1.1.0/24 named subnet-1
38+
3639
```yaml
3740
apiVersion: gateway.githedgehog.com/v1alpha1
3841
kind: Peering
@@ -47,7 +50,7 @@ spec:
4750
- 192.168.1.0/24
4851
vpc-2:
4952
ips:
50-
- cidr: 10.1.1.0/24
53+
- vpcSubnet: subnet-1 # just a shorthand for the VPC subnet, equivalent to `cidr: 10.1.1.0/24`
5154
as:
5255
- 192.168.2.0/24
5356
```
@@ -139,7 +142,7 @@ GW will receive routes for the whole internet (or whatever the external is peere
139142
- It will filter all routes for 192.168.0.0/16
140143
- It will filter all routes for internally routed subnets (regardless of public or private IP)
141144
- In this case, filter all routes for 1.2.3.0/24
142-
- This is an issue between VTEPs inside the gateway as well, probably don't want to replicate the whole internet
145+
- This is an issue between VTEPs inside the gateway as well, probably don't want to replicate the whole internet
143146
routing table inside the gateway
144147
145148
>[NOTE] The meaning of *not* is different when talking to an external, it is a route filter, not syntactic sugar
@@ -162,25 +165,25 @@ kind: Peering
162165
metadata:
163166
name: vpc-1--vpc-2
164167
spec:
165-
vpc1:
166-
ips:
167-
- cidr: 10.1.1.0/24
168-
# - fromVPCSubnet: subnet1 # just a shorthand for the above
169-
as: # Means static Src/Dst NAT for vpc1
170-
- 192.168.1.0/24
171-
ingress:
172-
- allow:
173-
stateless: true # it's the only options supported in the first release
174-
tcp:
175-
dstPort: 443
176-
vpc2:
177-
ips:
178-
- cidr: 10.2.1.1/32
179-
ingress:
180-
- allow:
181-
stateless: true
182-
tcp:
183-
srcPort: 443
168+
peering:
169+
vpc-1:
170+
ips:
171+
- cidr: 10.1.1.0/24
172+
as: # Means static Src/Dst NAT for vpc1
173+
- 192.168.1.0/24
174+
ingress:
175+
- allow:
176+
stateless: true # it's the only options supported in the first release
177+
tcp:
178+
dstPort: 443
179+
vpc-2:
180+
ips:
181+
- cidr: 10.2.1.1/32
182+
ingress:
183+
- allow:
184+
stateless: true
185+
tcp:
186+
srcPort: 443
184187
```
185188
186189
### Other examples
@@ -193,18 +196,17 @@ kind: Peering
193196
metadata:
194197
name: vpc-e1--vpc-e2
195198
spec:
196-
vpc-e1:
197-
ips:
198-
- cidr: 0.0.0.0/0
199-
- not: 10.0.0.0/8
200-
- not: 192.168.0.0/16
201-
- not: 1.2.3.0/24
202-
vpc-e2:
203-
ips:
204-
- cidr: 0.0.0.0/0
205-
- not: 10.0.0.0/8
206-
- not: 192.168.0.0/16
207-
- not: 3.2.1.0/30
199+
peering:
200+
vpc-e1:
201+
ips:
202+
- not: 10.0.0.0/8
203+
- not: 192.168.0.0/16
204+
- not: 1.2.3.0/24
205+
vpc-e2:
206+
ips:
207+
- not: 10.0.0.0/8
208+
- not: 192.168.0.0/16
209+
- not: 3.2.1.0/30
208210
```
209211
210212
```yaml
@@ -214,18 +216,18 @@ kind: Peering
214216
metadata:
215217
name: vpc-1--vpc-e1
216218
spec:
217-
vpc-1:
218-
ips:
219-
- cidr: 10.1.1.0/24
220-
as:
221-
- 192.168.1.0/30
222-
natType: stateful # as there are not enough IPs in the "as" pool
223-
vpc-e1:
224-
ips:
225-
- cidr: 0.0.0.0/0
226-
- not: 10.0.0.0/8
227-
- not: 192.168.0.0/16
228-
- not: 3.2.1.0/30
219+
peering:
220+
vpc-1:
221+
ips:
222+
- cidr: 10.1.1.0/24
223+
as:
224+
- 192.168.1.0/30
225+
natType: stateful # as there are not enough IPs in the "as" pool
226+
vpc-e1:
227+
ips:
228+
- not: 10.0.0.0/8
229+
- not: 192.168.0.0/16
230+
- not: 3.2.1.0/30
229231
```
230232
231233
```yaml
@@ -235,61 +237,38 @@ kind: Peering
235237
metadata:
236238
name: vpc-1--vpc-e1
237239
spec:
238-
vpc-1:
239-
ips:
240-
- cidr: 10.1.1.0/24
241-
as:
242-
- 192.168.1.0/30
243-
natType: stateful
244-
vpc-e1:
245-
metric: 0 # add 0 to the advertised route metrics
246-
# At what point do we not advertise these routes to the switch, how do we decide?
247-
ips:
248-
- cidr: 0.0.0.0/0
249-
- not: 10.0.0.0/8
250-
- not: 192.168.0.0/16
251-
- not: 1.2.3.0/30
240+
peering:
241+
vpc-1:
242+
ips:
243+
- cidr: 10.1.1.0/24
244+
as:
245+
- 192.168.1.0/30
246+
natType: stateful
247+
vpc-e1:
248+
metric: 0 # add 0 to the advertised route metrics
249+
# At what point do we not advertise these routes to the switch, how do we decide?
250+
ips:
251+
- not: 10.0.0.0/8
252+
- not: 192.168.0.0/16
253+
- not: 1.2.3.0/30
252254
---
253255
apiVersion: gateway.githedgehog.com/v1alpha1
254256
kind: Peering
255257
metadata:
256258
name: vpc-1--vpc-e2
257259
spec:
258-
vpc-1:
259-
ips:
260-
- cidr: 10.1.1.0/24
261-
as:
262-
- 192.168.1.0/30
263-
natType: stateful
264-
vpc-e2:
265-
metric: 10 # add 10 to the route metric advertised externally
266-
# At what point do we not advertise these routes to the switch, how do we decide?
267-
ips:
268-
- cidr: 0.0.0.0/0
269-
- not: 10.0.0.0/8
270-
- not: 192.168.0.0/16
271-
- not: 3.2.1.0/30
272-
```
273-
274-
```yaml
275-
# vpc-1 <> vpc-1 with overlapping subnets
276-
apiVersion: gateway.githedgehog.com/v1alpha1
277-
kind: Peering
278-
metadata:
279-
name: vpc-1--vpc-2
280-
spec:
281-
vpc-1:
282-
ips:
283-
- cidr: 10.1.1.0/24
284-
- not: 10.1.1.42/32
285-
as:
286-
- 192.168.1.0/24
287-
vpc-2:
288-
ips:
289-
- cidr: 10.1.1.0/24
290-
as:
291-
- 192.168.2.0/24
292-
293-
# { src: vpc-1,10.1.1.0/24 ; dst: 192.168.2.0/24 }
294-
# { src: vpc-2,10.1.1.0/24 ; dst: 192.168.1.0/24 }
260+
peering:
261+
vpc-1:
262+
ips:
263+
- cidr: 10.1.1.0/24
264+
as:
265+
- 192.168.1.0/30
266+
natType: stateful
267+
vpc-e2:
268+
metric: 10 # add 10 to the route metric advertised externally
269+
# At what point do we not advertise these routes to the switch, how do we decide?
270+
ips:
271+
- not: 10.0.0.0/8
272+
- not: 192.168.0.0/16
273+
- not: 3.2.1.0/30
295274
```

0 commit comments

Comments
 (0)