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
Copy file name to clipboardExpand all lines: geps/gep-1713/index.md
+43-8Lines changed: 43 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,7 @@ type ListenerSetSpec struct {
109
109
// Listeners in a `Gateway` and their attached `ListenerSets` are concatenated
110
110
// as a list when programming the underlying infrastructure.
111
111
//
112
+
// <gateway:util:excludeFromCRD>
112
113
// Listeners should be merged using the following precedence:
113
114
//
114
115
// 1. "parent" Gateway
@@ -118,12 +119,13 @@ type ListenerSetSpec struct {
118
119
// Regarding Conflict Management, Listeners in a ListenerSet follow the same
119
120
// rules of Listeners on a Gateway resource.
120
121
//
121
-
//This validation should happen within all of the ListenerSets attached to a
122
+
//Listener validation should happen within all of the ListenerSets attached to a
122
123
// Gateway, and the precedence of "parent Gateway" -> "oldest first" ->
123
124
// "alphabetically ordered" should be respected.
124
125
//
125
126
// ListenerSets containing conflicting Listeners MUST set the Conflicted
126
127
// Condition to true and clearly indicate which Listeners are conflicted.
128
+
// </gateway:util:excludeFromCRD>
127
129
//
128
130
// +listType=map
129
131
// +listMapKey=name
@@ -468,10 +470,41 @@ spec:
468
470
sectionName: foo
469
471
```
470
472
471
-
For instance, the following `HTTPRoute` attempts to attach to a listener defined in the parent `Gateway` using the sectionName `foo`. This is not valid and the route's status `Accepted` condition should be set to `False`
473
+
For instance, the following `HTTPRoute` attempts to attach to a listener defined in the parent `Gateway` using the sectionName `foo`, which also exists on a ListenerSet.
474
+
This is not valid and the route's status `Accepted` condition should be set to `False`
472
475
473
476
```yaml
474
477
apiVersion: gateway.networking.k8s.io/v1
478
+
kind: Gateway
479
+
metadata:
480
+
name: parent-gateway
481
+
spec:
482
+
gatewayClassName: example
483
+
allowedListeners:
484
+
namespaces:
485
+
from: Same
486
+
listeners:
487
+
- name: foo
488
+
hostname: foo.com
489
+
protocol: HTTP
490
+
port: 80
491
+
---
492
+
apiVersion: gateway.networking.x-k8s.io/v1alpha1
493
+
kind: ListenerSet
494
+
metadata:
495
+
name: first-workload-listeners
496
+
spec:
497
+
parentRef:
498
+
name: parent-gateway
499
+
kind: Gateway
500
+
group: gateway.networking.k8s.io
501
+
listeners:
502
+
- name: foo
503
+
hostname: first.foo.com
504
+
protocol: HTTP
505
+
port: 80
506
+
---
507
+
apiVersion: gateway.networking.k8s.io/v1
475
508
kind: HTTPRoute
476
509
metadata:
477
510
name: httproute-example
@@ -481,9 +514,6 @@ spec:
481
514
kind: Gateway
482
515
sectionName: foo
483
516
```
484
-
>--- Ricardo - above is a bit confusing, maybe ask Dave some clarification
485
-
486
-
487
517
488
518
#### Optional Section Name
489
519
@@ -570,12 +600,15 @@ ListenerSet conflicts should be managed similarly to [Gateway resource conflict]
570
600
management.
571
601
572
602
With ListenerSet this validation should happen within the same ListenerSet resource,
573
-
but MUST be validated also within a Gateway scope and all of the attached Listeners/ListenerSets.
603
+
but MUST be validated also within a Gateway scope and all of the attached Listeners/ListenerSets. The SectionName field is an exception for this validation, and while
604
+
it should not conflict within the same ListenerSet, it can be duplicated between
605
+
different ListenerSets.
574
606
575
607
This means that the validation should happen now between distinct ListenerSets
576
608
attached to the same Gateway, and in case of a conflict, the [Listener Precedence](#listener-precedence)
577
-
should be respected, and the conflicting listener MUST have a `Conflicted` condition
578
-
set to True and with an explicit reason on its message.
609
+
should be respected, so the first Listener on the precedence list MUST be accepted,
610
+
and should not have a `Conflicted` condition, while the conflicting listeners
611
+
MUST have a `Conflicted` condition set to True and with an explicit reason on its message.
579
612
580
613
Following are some examples of a conflict situation:
581
614
@@ -794,6 +827,8 @@ If a listener has a conflict, this should be reported in the `ListenerEntryStatu
794
827
795
828
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.
796
829
830
+
Conflicts are covered in the section [Listener and ListenerSet conflicts](#listener-and-listenerset-conflicts)
0 commit comments