You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* formatting
* clarify optional port semantics
* clarify listener name semantics
* clarify attachment/grants semantics
- Route attachment without sectionName
- re-order policy attachment section
- include a section about ReferenceGrants
* set proper min/max value for listenerentry.port
We had to drop the use of the PortNumber type because of
limitations with overriding min max using kubebuilder
annotations
* Update geps/gep-1713/index.md
Co-authored-by: Nick Young <[email protected]>
* Drop validation markers this is handled in another PR
See: #3750
* address Nick's feedback
* remove stray backtick
* address Rob's feedback
* incorporate gep changes into godoc
---------
Co-authored-by: Nick Young <[email protected]>
Copy file name to clipboardExpand all lines: geps/gep-1713/index.md
+35-25Lines changed: 35 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,8 @@ Thus updating a single `Gateway` resource with this many certificates is a conte
36
36
37
37
More broadly, large scale gateway users often expose `O(1000)` domains, but are currently limited by the maximum of 64 `listeners`.
38
38
39
-
The spec currently has language to indicate implementations `MAY` merge `Gateways` resources but does not define any specific requirements for how that should work.
The [spec currently has language](https://github.com/kubernetes-sigs/gateway-api/blob/541e9fc2b3c2f62915cb58dc0ee5e43e4096b3e2/apis/v1beta1/gateway_types.go#L76-L78) to indicate implementations `MAY` merge `Gateways` resources but does not define any specific requirements for how that should work.
40
+
41
41
42
42
## Feature Details
43
43
@@ -164,15 +164,8 @@ type ListenerEntry struct {
164
164
// Port is the network port. Multiple listeners may use the
165
165
// same port, subject to the Listener compatibility rules.
166
166
//
167
-
// If the port is specified as zero, the implementation will assign
168
-
// a unique port. If the implementation does not support dynamic port
169
-
// assignment, it MUST set `Accepted` condition to `False` with the
170
-
// `UnsupportedPort` reason.
171
-
//
172
167
// Support: Core
173
-
//
174
-
// +optional
175
-
Port *PortNumber `json:"port,omitempty"`
168
+
PortPortNumber`json:"port,omitempty"`
176
169
177
170
// Protocol specifies the network protocol this listener expects to receive.
178
171
//
@@ -385,8 +378,7 @@ spec:
385
378
```
386
379
### ListenerEntry
387
380
388
-
`ListenerEntry` is currently a copy of the `Listener` struct with some changes
389
-
1. `Port` is now a pointer to allow for dynamic port assignment.
381
+
`ListenerEntry` is currently a copy of the `Listener` struct with some changes noted in the below sections
390
382
391
383
## Semantics
392
384
@@ -399,7 +391,7 @@ When there are no listeners the `Gateway`'s `status.listeners` should be empty o
399
391
400
392
Implementations, when creating a `Gateway`, may provision underlying infrastructure when there are no listeners present. The status conditions `Accepted` and `Programmed` conditions should reflect state of this provisioning.
401
393
402
-
### Gateway <> ListenerSet Handshake
394
+
### Gateway & ListenerSet Handshake
403
395
404
396
By default a `Gateway` MUST NOT allow `ListenerSets` to be attached. Users can enable this behaviour by configuring their `Gateway` to allow `ListenerSet` attachment:
405
397
@@ -413,7 +405,7 @@ spec:
413
405
- from: Same
414
406
```
415
407
416
-
### Route Attaching
408
+
### Route Attachment
417
409
418
410
Routes MUST be able to specify a `ListenerSet` as a `parentRef`. Routes can use `sectionName`/`port` fields in `ParentReference` to help target a specific listener. If no listener is targeted (`sectionName`/`port` are unset) then the Route attaches to all the listeners in the `ListenerSet`.
419
411
@@ -461,10 +453,36 @@ spec:
461
453
sectionName: foo
462
454
```
463
455
456
+
#### Optional Section Name
457
+
458
+
If a `sectionName` in a Route's `parentRef` is not set then the Route MUST attach to only the listeners in the referenced parent. As an example given a `Gateway` and it's child `ListenerSets` a route attaching to the `Gateway` with an empty `sectionName` shall only attach to the listeners in the `Gateways` immediate `spec.listeners` list. In other words, the Route will not attach to any listeners in the `ListenerSets`. This is necessary because, for UX reasons, the `name` field does not have to be unique across all Listeners merged into a Gateway (see the section below for details).
459
+
460
+
### Policy Attachment
461
+
462
+
Policy attachment is [under discussion] in https://github.com/kubernetes-sigs/gateway-api/discussions/2927
463
+
464
+
Similar to Routes, `ListenerSet` can inherit policy from a Gateway.
465
+
Policies that attach to a `ListenerSet` apply to all listeners defined in that resource, but do not impact listeners in the parent `Gateway`. This allows `ListenerSets` attached to the same `Gateway` to have different policies.
466
+
If the implementation cannot apply the policy to only specific listeners, it should reject the policy.
467
+
468
+
### ReferenceGrant Semantics
469
+
470
+
When a `ReferenceGrant` is applied to a `Gateway` it MUST NOT be inherited by child `ListenerSets`. Thus a `ListenerSet` listener MUST NOT access secrets granted to the `Gateway` listeners.
471
+
472
+
When a `ReferenceGrant` is applied to a `ListenerSet` it MUST NOT grant permission to the parent `Gateway`'s listeners. Thus a `Gateway` listener MUST NOT access secrets granted to the `ListenerSet` listeners.
473
+
474
+
A `ListenerSet` must be able to reference a secret/backend in the same namespace as itself without a `ReferenceGrant`.
475
+
476
+
464
477
### Listener Validation
465
478
466
-
Implementations MUST treat the parent `Gateway`s as having the merged list of all listeners from itself and attached `ListenerSets`. See 'Listener Precedence' for more details on ordering.
467
-
Validation of this list of listeners MUST behave the same as if the list were part of a single `Gateway`.
479
+
Within a single resource such as a `Gateway` or `ListenerSet` the list of listeners MUST have unique names. Implementations MUST allow listeners from a child `ListenerSet` to be merged into a parent `Gateway` when listeners have the same name. Likewise implementations MUST allow sibling `ListenerSets` listeners with matching names to be merged into a parent `Gateway`. This allows for authors of Routes to simply attach to their desired parentRef and listener without having to worry about naming conflicts across resources.
480
+
481
+
It is up to the implementations how unique names are generated internally. One example would be to hash the `ListenerSet` name+namespace and prepend it to the listener entry `name`.
482
+
483
+
Implementations MUST treat the parent `Gateway`s as having the merged list of all listeners from itself and attached `ListenerSets` and validation of this list of listeners MUST behave the same as if the list were part of a single `Gateway` with the relaxed listener name constraints.
484
+
485
+
Ordering will follow the semantics defined in [Listener Precedence](#listener-precedence).
468
486
469
487
From the earlier example the above resources would be equivalent to a single `Gateway` where the listeners are collapsed into a single list.
470
488
@@ -514,7 +532,7 @@ Listeners should be merged using the following precedence:
514
532
515
533
Conflicts are covered in the section 'ListenerConditions within a ListenerSet'
516
534
517
-
### Gateway Conditions
535
+
### Gateway Conditions
518
536
519
537
`Gateway`'s `Accepted` and `Programmed` top-level conditions remain unchanged and reflect the status of the local configuration.
520
538
@@ -555,14 +573,6 @@ If a listener has a conflict, this should be reported in the `ListenerEntryStatu
555
573
556
574
Implementations SHOULD be cautious about what information from the parent or siblings are reported to avoid accidentally leaking sensitive information that the child would not otherwise have access to. This can include contents of secrets etc.
557
575
558
-
### Policy Attachment
559
-
560
-
Policy attachment is [under discussion] in https://github.com/kubernetes-sigs/gateway-api/discussions/2927
561
-
562
-
Similar to Routes, `ListenerSet` can inherit policy from a Gateway.
563
-
Policies that attach to a `ListenerSet` apply to all listeners defined in that resource, but do not impact listeners in the parent `Gateway`. This allows `ListenerSets` attached to the same `Gateway` to have different policies.
564
-
If the implementation cannot apply the policy to only specific listeners, it should reject the policy.
0 commit comments