Skip to content

Commit 021d5b9

Browse files
committed
remove GRPCRoute support, ensure documentation points toward HTTP -> GRPC upgrade using TG config
1 parent 5c88b5e commit 021d5b9

28 files changed

+43
-1839
lines changed

config/rbac/role.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -248,28 +248,6 @@ rules:
248248
- get
249249
- patch
250250
- update
251-
- apiGroups:
252-
- gateway.networking.k8s.io
253-
resources:
254-
- grpcroutes
255-
verbs:
256-
- get
257-
- list
258-
- watch
259-
- apiGroups:
260-
- gateway.networking.k8s.io
261-
resources:
262-
- grpcroutes/finalizers
263-
verbs:
264-
- update
265-
- apiGroups:
266-
- gateway.networking.k8s.io
267-
resources:
268-
- grpcroutes/status
269-
verbs:
270-
- get
271-
- patch
272-
- update
273251
- apiGroups:
274252
- gateway.networking.k8s.io
275253
resources:

controllers/gateway/eventhandlers/grpc_route_events.go

Lines changed: 0 additions & 72 deletions
This file was deleted.

controllers/gateway/eventhandlers/listener_rule_configuration_events.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import (
1515

1616
// NewEnqueueRequestsForListenerRuleConfigurationEvent creates handler for ListenerRuleConfiguration resources
1717
func NewEnqueueRequestsForListenerRuleConfigurationEvent(httpRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.HTTPRoute],
18-
grpcRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.GRPCRoute], k8sClient client.Client, logger logr.Logger) handler.TypedEventHandler[*elbv2gw.ListenerRuleConfiguration, reconcile.Request] {
18+
k8sClient client.Client, logger logr.Logger) handler.TypedEventHandler[*elbv2gw.ListenerRuleConfiguration, reconcile.Request] {
1919
return &enqueueRequestsForListenerRuleConfigurationEvent{
2020
httpRouteEventChan: httpRouteEventChan,
21-
grpcRouteEventChan: grpcRouteEventChan,
2221
k8sClient: k8sClient,
2322
logger: logger,
2423
}
@@ -29,7 +28,6 @@ var _ handler.TypedEventHandler[*elbv2gw.ListenerRuleConfiguration, reconcile.Re
2928
// enqueueRequestsForListenerRuleConfigurationEvent handles ListenerRuleConfiguration events
3029
type enqueueRequestsForListenerRuleConfigurationEvent struct {
3130
httpRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.HTTPRoute]
32-
grpcRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.GRPCRoute]
3331
k8sClient client.Client
3432
logger logr.Logger
3533
}
@@ -76,14 +74,6 @@ func (h *enqueueRequestsForListenerRuleConfigurationEvent) enqueueImpactedRoutes
7674
h.httpRouteEventChan <- event.TypedGenericEvent[*gatewayv1.HTTPRoute]{
7775
Object: route.GetRawRoute().(*gatewayv1.HTTPRoute),
7876
}
79-
case routeutils.GRPCRouteKind:
80-
h.logger.V(1).Info("enqueue grpcroute for listenerruleconfiguration event",
81-
"listenerruleconfiguration", ruleConfig.Name,
82-
"grpcroute", route.GetRouteNamespacedName())
83-
h.grpcRouteEventChan <- event.TypedGenericEvent[*gatewayv1.GRPCRoute]{
84-
Object: route.GetRawRoute().(*gatewayv1.GRPCRoute),
85-
}
8677
}
8778
}
88-
8979
}

controllers/gateway/eventhandlers/reference_grant_events.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ import (
1818

1919
// NewEnqueueRequestsForReferenceGrantEvent creates handler for ReferenceGrant resources
2020
func NewEnqueueRequestsForReferenceGrantEvent(httpRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.HTTPRoute],
21-
grpcRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.GRPCRoute],
2221
tcpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TCPRoute],
2322
udpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.UDPRoute],
2423
tlsRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TLSRoute],
2524
k8sClient client.Client, eventRecorder record.EventRecorder, logger logr.Logger) handler.TypedEventHandler[*gwbeta1.ReferenceGrant, reconcile.Request] {
2625
return &enqueueRequestsForReferenceGrantEvent{
2726
httpRouteEventChan: httpRouteEventChan,
28-
grpcRouteEventChan: grpcRouteEventChan,
2927
tcpRouteEventChan: tcpRouteEventChan,
3028
udpRouteEventChan: udpRouteEventChan,
3129
tlsRouteEventChan: tlsRouteEventChan,
@@ -40,7 +38,6 @@ var _ handler.TypedEventHandler[*gwbeta1.ReferenceGrant, reconcile.Request] = (*
4038
// enqueueRequestsForReferenceGrantEvent handles ReferenceGrant events
4139
type enqueueRequestsForReferenceGrantEvent struct {
4240
httpRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.HTTPRoute]
43-
grpcRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.GRPCRoute]
4441
tcpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TCPRoute]
4542
udpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.UDPRoute]
4643
tlsRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TLSRoute]
@@ -105,21 +102,6 @@ func (h *enqueueRequestsForReferenceGrantEvent) enqueueImpactedRoutes(ctx contex
105102
} else {
106103
h.logger.Error(err, "Unable to list impacted http routes for reference grant event handler")
107104
}
108-
case string(routeutils.GRPCRouteKind):
109-
if h.grpcRouteEventChan == nil {
110-
continue
111-
}
112-
routes, err := routeutils.ListGRPCRoutes(ctx, h.k8sClient, &client.ListOptions{Namespace: string(impactedFrom.Namespace)})
113-
if err == nil {
114-
for _, route := range routes {
115-
h.grpcRouteEventChan <- event.TypedGenericEvent[*gatewayv1.GRPCRoute]{
116-
Object: route.GetRawRoute().(*gatewayv1.GRPCRoute),
117-
}
118-
}
119-
120-
} else {
121-
h.logger.Error(err, "Unable to list impacted grpc routes for reference grant event handler")
122-
}
123105
case string(routeutils.TCPRouteKind):
124106
if h.tcpRouteEventChan == nil {
125107
continue

controllers/gateway/eventhandlers/service_events.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ import (
1919
// NewenqueueRequestsForServiceEvent detects changes to TargetGroupConfiguration and enqueues all gateway classes and gateways that
2020
// would effected by a change in the TargetGroupConfiguration
2121
func NewEnqueueRequestsForServiceEvent(httpRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.HTTPRoute],
22-
grpcRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.GRPCRoute],
2322
tcpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TCPRoute],
2423
udpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.UDPRoute],
2524
tlsRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TLSRoute], k8sClient client.Client, eventRecorder record.EventRecorder, logger logr.Logger, gwController string) handler.TypedEventHandler[*corev1.Service, reconcile.Request] {
2625
return &enqueueRequestsForServiceEvent{
2726
httpRouteEventChan: httpRouteEventChan,
28-
grpcRouteEventChan: grpcRouteEventChan,
2927
tcpRouteEventChan: tcpRouteEventChan,
3028
udpRouteEventChan: udpRouteEventChan,
3129
tlsRouteEventChan: tlsRouteEventChan,
@@ -40,7 +38,6 @@ var _ handler.TypedEventHandler[*corev1.Service, reconcile.Request] = (*enqueueR
4038

4139
type enqueueRequestsForServiceEvent struct {
4240
httpRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.HTTPRoute]
43-
grpcRouteEventChan chan<- event.TypedGenericEvent[*gatewayv1.GRPCRoute]
4441
tcpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TCPRoute]
4542
udpRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.UDPRoute]
4643
tlsRouteEventChan chan<- event.TypedGenericEvent[*gwalpha2.TLSRoute]
@@ -143,13 +140,6 @@ func (h *enqueueRequestsForServiceEvent) enqueueImpactedL7Routes(
143140
h.httpRouteEventChan <- event.TypedGenericEvent[*gatewayv1.HTTPRoute]{
144141
Object: route.GetRawRoute().(*gatewayv1.HTTPRoute),
145142
}
146-
case routeutils.GRPCRouteKind:
147-
h.logger.V(1).Info("enqueue grpcroute for service event",
148-
"service", svc.Name,
149-
"grpcroute", route.GetRouteNamespacedName())
150-
h.grpcRouteEventChan <- event.TypedGenericEvent[*gatewayv1.GRPCRoute]{
151-
Object: route.GetRawRoute().(*gatewayv1.GRPCRoute),
152-
}
153143
}
154144
}
155145
return

controllers/gateway/gateway_controller.go

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ type gatewayReconciler struct {
164164
//+kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes/status,verbs=get;update;patch
165165
//+kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=httproutes/finalizers,verbs=update
166166

167-
// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=grpcroutes,verbs=get;list;watch
168-
// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=grpcroutes/status,verbs=get;update;patch
169-
// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=grpcroutes/finalizers,verbs=update
170-
171167
func (r *gatewayReconciler) Reconcile(ctx context.Context, req reconcile.Request) (ctrl.Result, error) {
172168
r.reconcileTracker(req.NamespacedName)
173169
err := r.reconcileHelper(ctx, req)
@@ -484,18 +480,15 @@ func (r *gatewayReconciler) setupALBGatewayControllerWatches(ctrl controller.Con
484480
tbConfigEventChan := make(chan event.TypedGenericEvent[*elbv2gw.TargetGroupConfiguration])
485481
listenerRuleConfigEventChan := make(chan event.TypedGenericEvent[*elbv2gw.ListenerRuleConfiguration])
486482
httpRouteEventChan := make(chan event.TypedGenericEvent[*gwv1.HTTPRoute])
487-
grpcRouteEventChan := make(chan event.TypedGenericEvent[*gwv1.GRPCRoute])
488483
svcEventChan := make(chan event.TypedGenericEvent[*corev1.Service])
489484
tgConfigEventHandler := eventhandlers.NewEnqueueRequestsForTargetGroupConfigurationEvent(svcEventChan, r.k8sClient, r.eventRecorder,
490485
loggerPrefix.WithName("TargetGroupConfiguration"))
491-
listenerRuleConfigEventHandler := eventhandlers.NewEnqueueRequestsForListenerRuleConfigurationEvent(httpRouteEventChan, grpcRouteEventChan, r.k8sClient, loggerPrefix.WithName("ListenerRuleConfiguration"))
492-
grpcRouteEventHandler := eventhandlers.NewEnqueueRequestsForGRPCRouteEvent(r.k8sClient, r.eventRecorder,
493-
loggerPrefix.WithName("GRPCRoute"))
486+
listenerRuleConfigEventHandler := eventhandlers.NewEnqueueRequestsForListenerRuleConfigurationEvent(httpRouteEventChan, r.k8sClient, loggerPrefix.WithName("ListenerRuleConfiguration"))
494487
httpRouteEventHandler := eventhandlers.NewEnqueueRequestsForHTTPRouteEvent(r.k8sClient, r.eventRecorder,
495488
loggerPrefix.WithName("HTTPRoute"))
496-
svcEventHandler := eventhandlers.NewEnqueueRequestsForServiceEvent(httpRouteEventChan, grpcRouteEventChan, nil, nil, nil, r.k8sClient, r.eventRecorder,
489+
svcEventHandler := eventhandlers.NewEnqueueRequestsForServiceEvent(httpRouteEventChan, nil, nil, nil, r.k8sClient, r.eventRecorder,
497490
loggerPrefix.WithName("Service"), constants.ALBGatewayController)
498-
refGrantHandler := eventhandlers.NewEnqueueRequestsForReferenceGrantEvent(httpRouteEventChan, grpcRouteEventChan, nil, nil, nil, r.k8sClient, r.eventRecorder,
491+
refGrantHandler := eventhandlers.NewEnqueueRequestsForReferenceGrantEvent(httpRouteEventChan, nil, nil, nil, r.k8sClient, r.eventRecorder,
499492
loggerPrefix.WithName("ReferenceGrant"))
500493
if err := ctrl.Watch(source.Channel(tbConfigEventChan, tgConfigEventHandler)); err != nil {
501494
return err
@@ -506,9 +499,6 @@ func (r *gatewayReconciler) setupALBGatewayControllerWatches(ctrl controller.Con
506499
if err := ctrl.Watch(source.Channel(httpRouteEventChan, httpRouteEventHandler)); err != nil {
507500
return err
508501
}
509-
if err := ctrl.Watch(source.Channel(grpcRouteEventChan, grpcRouteEventHandler)); err != nil {
510-
return err
511-
}
512502
if err := ctrl.Watch(source.Channel(svcEventChan, svcEventHandler)); err != nil {
513503
return err
514504
}
@@ -527,9 +517,6 @@ func (r *gatewayReconciler) setupALBGatewayControllerWatches(ctrl controller.Con
527517
if err := ctrl.Watch(source.Kind(mgr.GetCache(), &gwv1.HTTPRoute{}, httpRouteEventHandler)); err != nil {
528518
return err
529519
}
530-
if err := ctrl.Watch(source.Kind(mgr.GetCache(), &gwv1.GRPCRoute{}, grpcRouteEventHandler)); err != nil {
531-
return err
532-
}
533520
return nil
534521
}
535522

@@ -548,9 +535,9 @@ func (r *gatewayReconciler) setupNLBGatewayControllerWatches(ctrl controller.Con
548535
loggerPrefix.WithName("UDPRoute"))
549536
tlsRouteEventHandler := eventhandlers.NewEnqueueRequestsForTLSRouteEvent(r.k8sClient, r.eventRecorder,
550537
loggerPrefix.WithName("TLSRoute"))
551-
svcEventHandler := eventhandlers.NewEnqueueRequestsForServiceEvent(nil, nil, tcpRouteEventChan, udpRouteEventChan, tlsRouteEventChan, r.k8sClient, r.eventRecorder,
538+
svcEventHandler := eventhandlers.NewEnqueueRequestsForServiceEvent(nil, tcpRouteEventChan, udpRouteEventChan, tlsRouteEventChan, r.k8sClient, r.eventRecorder,
552539
loggerPrefix.WithName("Service"), constants.NLBGatewayController)
553-
refGrantHandler := eventhandlers.NewEnqueueRequestsForReferenceGrantEvent(nil, nil, tcpRouteEventChan, udpRouteEventChan, tlsRouteEventChan, r.k8sClient, r.eventRecorder,
540+
refGrantHandler := eventhandlers.NewEnqueueRequestsForReferenceGrantEvent(nil, tcpRouteEventChan, udpRouteEventChan, tlsRouteEventChan, r.k8sClient, r.eventRecorder,
554541
loggerPrefix.WithName("ReferenceGrant"))
555542
if err := ctrl.Watch(source.Channel(tbConfigEventChan, tgConfigEventHandler)); err != nil {
556543
return err

controllers/gateway/route_reconciler.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ func (d *routeReconcilerImpl) handleRouteStatusUpdate(routeData routeutils.Route
8484
switch routeKind {
8585
case "HTTPRoute":
8686
route = &gwv1.HTTPRoute{}
87-
case "GRPCRoute":
88-
route = &gwv1.GRPCRoute{}
8987
case "UDPRoute":
9088
route = &gwalpha2.UDPRoute{}
9189
case "TCPRoute":
@@ -129,13 +127,6 @@ func (d *routeReconcilerImpl) updateRouteStatus(route client.Object, routeData r
129127
}
130128
originalRouteStatus = r.Status.Parents
131129
ParentRefs = r.Spec.ParentRefs
132-
case *gwv1.GRPCRoute:
133-
controllerName = constants.ALBGatewayController
134-
if r.Status.Parents == nil {
135-
r.Status.Parents = []gwv1.RouteParentStatus{}
136-
}
137-
originalRouteStatus = r.Status.Parents
138-
ParentRefs = r.Spec.ParentRefs
139130
case *gwalpha2.UDPRoute:
140131
if r.Status.Parents == nil {
141132
r.Status.Parents = []gwv1.RouteParentStatus{}
@@ -195,8 +186,6 @@ func (d *routeReconcilerImpl) updateRouteStatus(route client.Object, routeData r
195186
switch r := route.(type) {
196187
case *gwv1.HTTPRoute:
197188
r.Status.Parents = newRouteStatus
198-
case *gwv1.GRPCRoute:
199-
r.Status.Parents = newRouteStatus
200189
case *gwalpha2.TLSRoute:
201190
r.Status.Parents = newRouteStatus
202191
case *gwalpha2.UDPRoute:
@@ -366,8 +355,6 @@ func getRouteStatus(route client.Object) []gwv1.RouteParentStatus {
366355
switch r := route.(type) {
367356
case *gwv1.HTTPRoute:
368357
routeStatus = r.Status.Parents
369-
case *gwv1.GRPCRoute:
370-
routeStatus = r.Status.Parents
371358
case *gwalpha2.TLSRoute:
372359
routeStatus = r.Status.Parents
373360
case *gwalpha2.UDPRoute:

controllers/gateway/utils_test.go

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -712,11 +712,6 @@ func Test_generateRouteList(t *testing.T) {
712712
name: "some routes",
713713
routes: map[int32][]routeutils.RouteDescriptor{
714714
1: {
715-
&routeutils.MockRoute{
716-
Name: "1-1-r",
717-
Namespace: "1-1-ns",
718-
Kind: routeutils.GRPCRouteKind,
719-
},
720715
&routeutils.MockRoute{
721716
Name: "1-2-r",
722717
Namespace: "1-2-ns",
@@ -734,11 +729,6 @@ func Test_generateRouteList(t *testing.T) {
734729
},
735730
},
736731
2: {
737-
&routeutils.MockRoute{
738-
Name: "2-1-r",
739-
Namespace: "2-1-ns",
740-
Kind: routeutils.GRPCRouteKind,
741-
},
742732
&routeutils.MockRoute{
743733
Name: "2-2-r",
744734
Namespace: "2-2-ns",
@@ -756,11 +746,6 @@ func Test_generateRouteList(t *testing.T) {
756746
},
757747
},
758748
3: {
759-
&routeutils.MockRoute{
760-
Name: "3-1-r",
761-
Namespace: "3-1-ns",
762-
Kind: routeutils.GRPCRouteKind,
763-
},
764749
&routeutils.MockRoute{
765750
Name: "3-2-r",
766751
Namespace: "3-2-ns",
@@ -778,11 +763,6 @@ func Test_generateRouteList(t *testing.T) {
778763
},
779764
},
780765
4: {
781-
&routeutils.MockRoute{
782-
Name: "4-1-r",
783-
Namespace: "4-1-ns",
784-
Kind: routeutils.GRPCRouteKind,
785-
},
786766
&routeutils.MockRoute{
787767
Name: "4-2-r",
788768
Namespace: "4-2-ns",
@@ -800,7 +780,7 @@ func Test_generateRouteList(t *testing.T) {
800780
},
801781
},
802782
},
803-
expected: "(GRPCRoute, 1-1-ns:1-1-r),(GRPCRoute, 2-1-ns:2-1-r),(GRPCRoute, 3-1-ns:3-1-r),(GRPCRoute, 4-1-ns:4-1-r),(HTTPRoute, 1-3-ns:1-3-r),(HTTPRoute, 2-3-ns:2-3-r),(HTTPRoute, 3-3-ns:3-3-r),(HTTPRoute, 4-3-ns:4-3-r),(TCPRoute, 1-2-ns:1-2-r),(TCPRoute, 2-2-ns:2-2-r),(TCPRoute, 3-2-ns:3-2-r),(TCPRoute, 4-2-ns:4-2-r),(UDPRoute, 1-4-ns:1-4-r),(UDPRoute, 2-4-ns:2-4-r),(UDPRoute, 3-4-ns:3-4-r),(UDPRoute, 4-4-ns:4-4-r)",
783+
expected: "(HTTPRoute, 1-3-ns:1-3-r),(HTTPRoute, 2-3-ns:2-3-r),(HTTPRoute, 3-3-ns:3-3-r),(HTTPRoute, 4-3-ns:4-3-r),(TCPRoute, 1-2-ns:1-2-r),(TCPRoute, 2-2-ns:2-2-r),(TCPRoute, 3-2-ns:3-2-r),(TCPRoute, 4-2-ns:4-2-r),(UDPRoute, 1-4-ns:1-4-r),(UDPRoute, 2-4-ns:2-4-r),(UDPRoute, 3-4-ns:3-4-r),(UDPRoute, 4-4-ns:4-4-r)",
804784
},
805785
}
806786

0 commit comments

Comments
 (0)