Skip to content

Commit 2fe7137

Browse files
authored
Update the ListenerSet GEP per Kubecon discussions (#4286)
* Update the GEP per Kubecon discussions * Remove useless condition, add hot migration * attachedListeners should reflect accepted listeners only * Rename attachedListeners to attachedListenerSets
1 parent fde94f2 commit 2fe7137

File tree

1 file changed

+49
-19
lines changed

1 file changed

+49
-19
lines changed

geps/gep-1713/index.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ From [Gateway Hierarchy Brainstorming](https://docs.google.com/document/d/1qj7Xo
2222
- Provide a mechanism for third party components to generate listeners and attach them to a Gateway ([\#1863](https://github.com/kubernetes-sigs/gateway-api/pull/1863))
2323
- Delegate TLS certificate management to App Owners and/or different namespaces ([\#102](https://github.com/kubernetes-sigs/gateway-api/issues/102), [\#103](https://github.com/kubernetes-sigs/gateway-api/issues/103))
2424
- Delegate domains to different namespaces, but allow those namespace to define TLS and routing configuration within those namespaces with Gateway-like resources ([\#102](https://github.com/kubernetes-sigs/gateway-api/issues/102), [\#103](https://github.com/kubernetes-sigs/gateway-api/issues/103))
25-
- Enable admins to delegate SNI-based routing for TLS passthrough to other teams and/or namespaces ([\#3177](https://github.com/kubernetes-sigs/gateway-api/discussions/3177)) (Remove TLSRoute)
25+
- Enable admins to delegate SNI-based routing for TLS passthrough to other teams and/or namespaces ([\#3177](https://github.com/kubernetes-sigs/gateway-api/discussions/3177))
2626
- Simplify L4 routing by removing at least one of the required layers (Gateway \-\> Route \-\> Service)
2727
- Delegate routing to namespaces based on path prefix (previously known as [Route delegation](https://github.com/kubernetes-sigs/gateway-api/issues/1058))
2828
- Static infrastructure attachment ([\#3103](https://github.com/kubernetes-sigs/gateway-api/discussions/3103\#discussioncomment-9678523))
@@ -38,13 +38,16 @@ More broadly, large scale gateway users often expose `O(1000)` domains, but are
3838

3939
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.
4040

41+
Additionally, one of the main complains of users coming from Ingress to Gateway API is the
42+
lack of possibility to manage their own application certificates. `ListenerSet`, being a
43+
mechanism that allows users to define their own Listeners and attach them to a `Gateway`
44+
will make this requirement viable.
4145

4246
## Feature Details
4347

4448
We define `ListenerSet` as the name of the feature outlined in this GEP.
4549
The feature will be part of the experimental channel, which implementations can choose to support. All the `MUST` requirements in this document apply to implementations that choose to support this feature.
4650

47-
4851
## API
4952

5053
This proposal introduces a new `ListenerSet` resource that has the ability to attach a set of listeners to multiple parent `Gateways`.
@@ -57,11 +60,33 @@ once the API is graduated to stable it will be renamed to `ListenerSet`.
5760
```go
5861
type GatewaySpec struct {
5962
...
63+
// AllowedListeners defines which ListenerSets can be attached to this Gateway.
64+
// While this feature is experimental, the default value is to allow no ListenerSets.
65+
//
6066
AllowedListeners *AllowedListeners `json:"allowedListeners"`
67+
}
68+
69+
type GatewayStatus struct {
6170
...
71+
// AttachedListenerSets represents the total number of ListenerSets that have been
72+
// successfully attached to this Gateway.
73+
//
74+
// A ListenerSet is successfully attached to a Gateway when all the following conditions are met:
75+
// - The ListenerSet is selected by the Gateway's AllowedListeners field
76+
// - The ListenerSet has a valid ParentRef selecting the Gateway
77+
// - The ListenerSet's status has the condition "Accepted: true"
78+
//
79+
// Uses for this field include troubleshooting AttachedListenerSets attachment and
80+
// measuring blast radius/impact of changes to a Gateway.
81+
// +optional
82+
AttachedListenerSets *int32 `json:"attachedListenerSets,omitempty"`
6283
}
6384

6485
type AllowedListeners struct {
86+
// Namespaces defines which namespaces ListenerSets can be attached to this Gateway.
87+
// While this feature is experimental, the default value is to allow no ListenerSets.
88+
//
89+
// +optional
6590
// +kubebuilder:default={from: None}
6691
Namespaces *ListenerNamespaces `json:"namespaces,omitempty"`
6792
}
@@ -178,20 +203,19 @@ type ListenerEntry struct {
178203

179204
// Port is the network port. Multiple listeners may use the
180205
// same port, subject to the Listener compatibility rules.
181-
//
182-
// If the port is not set or specified as zero, the implementation will assign
206+
//
207+
// If the port is not set, the implementation will assign
183208
// a unique port. If the implementation does not support dynamic port
184209
// assignment, it MUST set `Accepted` condition to `False` with the
185210
// `UnsupportedPort` reason.
186-
//
211+
//
187212
// Support: Core
188213
//
189214
// +optional
190215
//
191-
// +kubebuilder:default=0
192-
// +kubebuilder:validation:Minimum=0
216+
// +kubebuilder:validation:Minimum=1
193217
// +kubebuilder:validation:Maximum=65535
194-
Port PortNumber `json:"port,omitempty"`
218+
Port *PortNumber `json:"port,omitempty"`
195219

196220
// Protocol specifies the network protocol this listener expects to receive.
197221
//
@@ -699,6 +723,17 @@ should be respected, so the first Listener on the precedence list MUST be accept
699723
and should not have a `Conflicted` condition, while the conflicting listeners
700724
MUST have a `Conflicted` condition set to True and with an explicit reason on its message.
701725

726+
A `Route` MAY attach to a `Conflicted` ListenerSet, and once this ListenerSet is not conflicted
727+
anymore the implementations SHOULD support that the traffic of this route is accepted on
728+
this ListenerSet and flow without downtime.
729+
730+
As an example, given 2 ListenerSets attached to the same Gateway, being one of them conflicted with
731+
the other, and a `HTTPRoute` attached to both ListenerSets, once the old `ListenerSet` is deleted
732+
the new `ListenerSet` should become valid then the traffic should flow to the new `ListenerSet` without
733+
disruption.
734+
735+
This feature will be supported by the feature `ListenerSetHotMigration`.
736+
702737
Following are some examples of a conflict situation:
703738

704739
#### Conflict between ListenerSet and parent Gateway
@@ -769,7 +804,7 @@ status:
769804
protocol: HTTPS
770805
port: 443
771806
conditions:
772-
- message: ListenerSet has conflicts with Gateway 'infra/parent-gateway'
807+
- message: ListenerSet has conflicts with Gateway 'infra/parent-gateway'
773808
reason: ParentNotAccepted
774809
status: "False"
775810
type: Accepted
@@ -879,19 +914,14 @@ status:
879914
type: Accepted
880915
```
881916

882-
### Gateway Conditions
883-
884-
`Gateway`'s `Accepted` and `Programmed` top-level conditions remain unchanged and reflect the status of the local configuration.
885-
886-
Implementations MUST support a new `Gateway` condition type `AttachedListenerSets`.
917+
### Gateway Status
887918

888-
The condition's `Status` has the following values:
919+
`Gateway` status MUST report the number of successful attached listeners to `.status.attachedListenerSets`.
889920

890-
- `True` when `Spec.AllowedListeners` is set and at least one child Listener arrives from a `ListenerSet`
891-
- `False` when `Spec.AllowedListeners` is set but has no valid listeners are attached
892-
- `Unknown` when no `Spec.AllowedListeners` config is present
921+
### Gateway Conditions
893922

894-
Parent `Gateways` MUST NOT have `ListenerSet` listeners in their `status.listeners` conditions list.
923+
`Gateway`'s `Accepted` and `Programmed` top-level conditions remain unchanged and reflect the status of the local configuration.
924+
conditions list.
895925
896926
### ListenerSet Conditions
897927

0 commit comments

Comments
 (0)