-
Notifications
You must be signed in to change notification settings - Fork 182
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
frontend: add support for gateway-api #2504
base: main
Are you sure you want to change the base?
frontend: add support for gateway-api #2504
Conversation
d09a4e8
to
4fde392
Compare
@joaquimrocha I'm not sure, if it's better to move this into a plugin or make gateway more present. This only adds stable resources. What do you think? Views can be improved. |
Hi @farodin91 @joaquimrocha (and rest of team) has been busy the last days with very many release related things, and also some holidays. To plugin or not? The gateway API is part of the Kubernetes project, so in that sense maybe it should be in Headlamp... but yeah... it's not a core Kubernetes thing. The other question to ask, is how commonly it's used? To me it's not entirely clear where it should be. Maybe you could provide more context? |
4fde392
to
d2fd515
Compare
@illume i think Kubernetes is pushing gateway API for the last month quiet hard. I would say. It's now stable. |
1e18382
to
05c4bee
Compare
@joaquimrocha Yeah, I agree it should go in headlamp rather than a plugin. This week I was learning about gateway API. Basically it’s the successor to Ingress. My understanding is gateway API is cleaning and standardizing things, and addressing missing spots (L4-L7 vs only http L7). As of the 1.2 release in October, quite a lot of the API is stable. There's several implementations of the http/TLS routers, less of the GRPC routers, and even fewer of the mesh routers (which is the main part left with experimental APIs AFAIK). |
e232b95
to
35481cd
Compare
@illume Would you like to review this PR? I think the ui can be improved or extend over time. Their is also a magic route called |
@@ -166,6 +166,29 @@ function prepareRoutes( | |||
}, | |||
], | |||
}, | |||
{ | |||
name: 'gateway', |
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.
What about putting these in Network?
- Gateways
- Gateway Classes
- Gateway HTTP Routes
- Gateway GRPC Routes
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.
I thought about it, but gateway api are multiple resource. it would increase network too much and another idea could be to hide gateway when not installed.
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.
Left some notes about API fields, and also a note about apiVersion should be v1 or both v1 and v1betav1?
frontend/src/lib/k8s/gateway.ts
Outdated
import { KubeObject, KubeObjectInterface } from './KubeObject'; | ||
|
||
export interface GatewayParentReference { | ||
group: string; |
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.
These should have documentation.
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ParentReference
frontend/src/lib/k8s/gateway.ts
Outdated
group: string; | ||
kind: string; | ||
namespace: string; | ||
sectionName: string | null; |
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.
sectionName is listed as optional. I guess it also needs ?
frontend/src/lib/k8s/gateway.ts
Outdated
namespace: string; | ||
sectionName: string | null; | ||
name: string; | ||
[key: string]: any; |
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.
I think port: portNumber
is missing here?
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ParentReference
[key: string]: any; | ||
} | ||
export interface GatewayListenerStatus { | ||
name: string; |
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.
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ListenerStatus
These fields are missing: supportedKinds, attachedRoutes
frontend/src/lib/k8s/gateway.ts
Outdated
[key: string]: any; | ||
} | ||
export interface GatewayAddress { | ||
type: string; |
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.
type is optional according to here:
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.GatewayAddress
The AddressType type seems like it can have many implementation specific different strings, and some specified ones. Probably string type is ok, but a comment about the field would be good. https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.AddressType
Yeah, let's add it to the core. |
It takes quite a long time spinning on a cluster when there's no gateways. I don't think that should block this being merged, but something to look at at some point. Same on a cluster with a gateway, but when there is no GRPC routes... the spinner takes quite a while before saying there are no routes. |
|
I can't find such a route in the Headlamp source. Also couldn't see something called 'gateway' in k8s outside of gateway API stuff. What about 'gatewayapi' as an alternative name to k8sgateway? Will have another look in the morning... maybe it's just too late. |
I haven't tested with a mesh yet. Just from browsing the source, it looks like Mesh Profile isn't done yet? If it's not done, should we add that in future PRs? It might be good to list anything missing you know of in a future work section of the PR description? Or we can start an issue I guess. |
btw, I presented Headlamp to some folks at Kubecon and asked them some questions about gateway API. They showed me a policy visualizer. There I also found out about gwctl https://github.com/kubernetes-sigs/gwctl?tab=readme-ov-file#visualizing-relationships-with-dot-graphs-using-gwctl-get--o-graph Also they told me about a gateway api sig meeting where we could take this to show them and get feedback if we want. |
35481cd
to
62bb37d
Compare
is fixed now. it was the sidebar path. |
@illume i have updated the resource. What do you think? |
7f9e7dc
to
57d728c
Compare
57d728c
to
fa3ce80
Compare
Signed-off-by: farodin91 <[email protected]>
Signed-off-by: farodin91 <[email protected]>
fa3ce80
to
61975b7
Compare
Signed-off-by: farodin91 <[email protected]>
61975b7
to
a1a6c60
Compare
How to test
Testing with Minikube and Envoy
Testing done
Future work
This is stuff out of scope of this PR. (We should probably add an issue for that)