Skip to content
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

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

farodin91
Copy link
Contributor

@farodin91 farodin91 commented Oct 30, 2024

image

How to test

Testing with Minikube and Envoy

Testing done

  • smoke tested with minikube and envoy gateway
  • tested it with a remote cluster that doesn't have any gateways used (and it reports not gateways successfully)
  • checked fields against API specs
  • reviewed component states in storybook

Future work

This is stuff out of scope of this PR. (We should probably add an issue for that)

  • experimental features
  • Testing with a service mesh, and mesh related gateway functionality
  • add better http route rule UX (filters, backends,...)
  • add tls UX to gateway
  • add gateway api to map feature
  • ...

@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch from d09a4e8 to 4fde392 Compare October 30, 2024 21:24
@farodin91
Copy link
Contributor Author

@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.

@illume
Copy link
Collaborator

illume commented Nov 4, 2024

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?

@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch from 4fde392 to d2fd515 Compare November 6, 2024 20:55
@farodin91
Copy link
Contributor Author

@illume i think Kubernetes is pushing gateway API for the last month quiet hard. I would say. It's now stable.

@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch 3 times, most recently from 1e18382 to 05c4bee Compare November 7, 2024 22:14
@illume
Copy link
Collaborator

illume commented Nov 12, 2024

@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).

@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch 3 times, most recently from e232b95 to 35481cd Compare November 16, 2024 14:01
@farodin91 farodin91 marked this pull request as ready for review November 16, 2024 14:07
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Nov 16, 2024
@farodin91
Copy link
Contributor Author

@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 gateway, so i had to change route to k8sgateway. Do you have an idea why their is a magic route?

Copy link
Collaborator

@illume illume left a 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 Show resolved Hide resolved
frontend/src/lib/k8s/gateway.ts Outdated Show resolved Hide resolved
frontend/src/lib/k8s/gateway.ts Outdated Show resolved Hide resolved
frontend/src/lib/k8s/gateway.ts Show resolved Hide resolved
frontend/src/lib/k8s/gateway.ts Outdated Show resolved Hide resolved
frontend/src/lib/k8s/grpcRoute.ts Outdated Show resolved Hide resolved
@joaquimrocha
Copy link
Collaborator

@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.

Yeah, let's add it to the core.

@illume
Copy link
Collaborator

illume commented Nov 18, 2024

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.

@illume
Copy link
Collaborator

illume commented Nov 18, 2024

  • I tested it with minikube and Envoy locally. ✅
  • Also tested it with a remote cluster that doesn't have any gateways used. ✅

@illume
Copy link
Collaborator

illume commented Nov 18, 2024

Their is also a magic route called gateway, so i had to change route to k8sgateway. Do you have an idea why their is a magic route?

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.

@illume
Copy link
Collaborator

illume commented Nov 18, 2024

I think the ui can be improved or extend over time

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.

@illume
Copy link
Collaborator

illume commented Nov 18, 2024

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.

@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch from 35481cd to 62bb37d Compare November 19, 2024 17:25
@farodin91
Copy link
Contributor Author

Their is also a magic route called gateway, so i had to change route to k8sgateway. Do you have an idea why their is a magic route?

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.

is fixed now. it was the sidebar path.

@farodin91
Copy link
Contributor Author

@illume i have updated the resource. What do you think?

@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch 4 times, most recently from 7f9e7dc to 57d728c Compare November 27, 2024 20:55
@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch 3 times, most recently from 61975b7 to a1a6c60 Compare December 12, 2024 11:57
@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch 2 times, most recently from c97919d to 5827403 Compare January 3, 2025 15:06
Signed-off-by: farodin91 <[email protected]>
@farodin91 farodin91 force-pushed the add-support-for-gateway-api branch from 5827403 to 8e4a99d Compare January 3, 2025 15:44
@illume
Copy link
Collaborator

illume commented Jan 8, 2025

The container e2e test was shown as failed, and it looked like a temporary error so I reran it... and it passes now.

@illume illume mentioned this pull request Jan 8, 2025
7 tasks
@illume
Copy link
Collaborator

illume commented Jan 8, 2025

I added an issue for the future work listed in the PR description:

Copy link
Collaborator

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I marked all of the convos resolved.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 8, 2025
@illume illume merged commit ba4555e into headlamp-k8s:main Jan 8, 2025
15 checks passed
@sniok
Copy link
Contributor

sniok commented Jan 8, 2025

What's the strategy for clusters that don't support api gateway yet? Currently I'm getting a spinner

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants