-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kgateway-waypoint: initial implementation #10783
base: main
Are you sure you want to change the base?
Conversation
a349fb4
to
229f833
Compare
257a5cb
to
77c095d
Compare
func (s Service) IsHeadless() bool { | ||
switch o := s.Object.(type) { | ||
case *corev1.Service: | ||
return o.Spec.ClusterIP == "None" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return o.Spec.ClusterIP == "None" | |
return o.Spec.ClusterIP == corev1.ClusterIPNone |
For context, our goal is to eventually use a the controller name on the gateway class to know if we own a gateway class (instead of the gateway class name); so with that in mind a closure seemed like an easier way to get there |
Sounds good. Assuming we supported other gateway classes, I'd imagine it would be:
Do we really need to have a closure? At the very least, we could probably move where that closure starts getting passed down; it seemed like it was several layers deep but only used in the GatewayIndex. If the list of (or single) controller name is env-driven, it could just be a func in |
Should I revert this in the short-term? |
7dc87fb
to
1747e25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a huge PR. LGTM
waypointClass: | ||
enabled: true | ||
name: "kgateway-waypoint" | ||
description: "KGateway Waypoint Controller" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the docs site it seems that kgateway
is always lower-case unless the sentence starting with it. Should we unify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments re-init code
gwl := &apiv1.GatewayList{} | ||
if err := cli.List(ctx, gwl); err != nil { | ||
return nil | ||
} | ||
|
||
var reqs []reconcile.Request | ||
for _, gw := range gwl.Items { | ||
if string(gw.Spec.GatewayClassName) == gc.Name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider: index gw by gateway class name; though not sure it is a big deal in terms of perf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done; if we have a ton of Istio gateways/waypoints then it will matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the related pieces are moved into this smaller PR.
Description
#10453
This PR adds support for a new GatewayClass
kgateway-waypoint
, which can be use in place of Istio's default Waypoint implementation.There are some sample YAMLs included, but the basic flow is:
istio.io/use-waypoint=<gateway name
(and optionallyistio.io/use-waypoint-namespace=<ns the gw is in>
for out-of-namespace waypoints)This PR only supports the most basic features of a Waypoint:
Potential follow ups include:
API changes
GatewayClass
namedkgateway-waypoint
service.kind
out ofgateway
and onto thegatewayClass
andwaypointClass
values.Code changes
Helm
Core
isOurGw
andExtraGatewayClasses
in favor of a statically definedSet
of known classes. This can be expanded later to read from an env var, but we shouldn't be passing a closure around for this.Waypoint Specific
waypoint
plugin that provides a new translatorsandwich
plugin that can be added at the Listener level to enable PROXY protocol inbound, and restore the client identity authenticated by zTunnel (Waypoint Sandwiches)CI changes
Docs changes
Context
#10453
Testing steps
examples/waypoint
directory.Checklist: