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

Add Support for User-Defined Gateway Addresses #360

Closed
danehans opened this issue Sep 7, 2022 · 12 comments
Closed

Add Support for User-Defined Gateway Addresses #360

danehans opened this issue Sep 7, 2022 · 12 comments
Assignees
Labels
kind/enhancement New feature or request provider/kubernetes Issues related to the Kubernetes provider
Milestone

Comments

@danehans
Copy link
Contributor

danehans commented Sep 7, 2022

#352 adds support for managing gateway status addresses. However, this PR does not support user-defined Gateway addresses. Therefore, EG should compare the status address of the Gateway's associated service against the user-defined address and surface the proper Gateway status condition.

@danehans danehans added the kind/enhancement New feature or request label Sep 7, 2022
@danehans danehans added help wanted Extra attention is needed provider/kubernetes Issues related to the Kubernetes provider labels Sep 7, 2022
@danehans danehans added this to the 0.2.0-rc2 milestone Sep 7, 2022
@danehans danehans modified the milestones: 0.2.0-rc2, Backlog Sep 9, 2022
@shawnh2
Copy link
Contributor

shawnh2 commented Apr 11, 2023

hi, is this issue still available? i'd like to working on it.

@zirain zirain removed the help wanted Extra attention is needed label Apr 11, 2023
@Xunzhuo
Copy link
Member

Xunzhuo commented Apr 11, 2023

Great, thanks @shawnh2

@shawnh2
Copy link
Contributor

shawnh2 commented Apr 12, 2023

hi guys, running through few things.

  • EG should compare the status address of the Gateway's associated service against the user-defined address and surface the proper Gateway status condition.

    How to define proper?

  • I couldn't see any operations on GatewaySpec.Addresses for now in EG, so what's troubling me most is WHAT is our implementation or purpose on this field? FYI, I checked out Contour, it only support a single address, and that address should also be appeared in statusAddresses.

@arkodg
Copy link
Contributor

arkodg commented Apr 12, 2023

@shawnh2 the Gateway API allows the user to define a custom address at the Gateway level
https://github.com/kubernetes-sigs/gateway-api/blob/a78e09220feec7947eb1a08b658b45f3b4182d7f/apis/v1beta1/gateway_types.go#L142
we need to first figure out if we / Envoy Gateway can support this feature or not i.e. can we set these addresses on the K8s Service or not.

If that is possible, we will also need to read those values and update the status

func UpdateGatewayStatusProgrammedCondition(gw *gwapiv1b1.Gateway, svc *corev1.Service, deployment *appsv1.Deployment) {

@arkodg
Copy link
Contributor

arkodg commented Apr 13, 2023

as @tommie suggested, the user defined gateway addresses might need to be set in service.Spec.ExternalIPs https://kubernetes.io/docs/concepts/services-networking/service/#external-ips in the infra mgr layer and also used to update Gateway Status

@tommie
Copy link
Contributor

tommie commented Apr 14, 2023

I codified a PoC in https://github.com/envoyproxy/gateway/compare/release/v0.3...tommie:envoyproxy-gateway:external-ips?expand=1

It only cares about IPAddress addresses, there are no tests, etc.

Based off of v0.3 because of #1307.

@shawnh2
Copy link
Contributor

shawnh2 commented Apr 14, 2023

I codified a PoC in https://github.com/envoyproxy/gateway/compare/release/v0.3...tommie:envoyproxy-gateway:external-ips?expand=1

It only cares about IPAddress addresses, there are no tests, etc.

Based off of v0.3 because of #1307.

hi, looking great, mind i merge it into my branch first? and i will complete the rest.

@tommie
Copy link
Contributor

tommie commented Apr 14, 2023

@shawnh2 go for it!

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

@github-actions github-actions bot added the stale label May 14, 2023
@LanceEa
Copy link
Contributor

LanceEa commented Jul 10, 2023

I see this issue is still open but was referenced by PR #1322
which implemented support for Service.spec.ExternalIPs. However, this doesn't work for all clouds, AFAIK.

I can confirm what was mentioned here: #1405 (comment)
is true for GKE. In GKE, it leverages the Service.spec.loadBalancerIP field and the GKE admission controller actually
fails to create the service if ExternalIPs is filled in. https://cloud.google.com/kubernetes-engine/docs/concepts/service-load-balancer-parameters#spd-static-ip

Looking at the K8s docs, it says the Service.spec.loadBalancerIP was deprecated in 1.24 https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer but it doesn't say to use the ExternalIPs but rather use Gateway which is weird because all cloud vendors don't have Gateway support. When I look at the docs for the ExternalIPs it has a note saying that K8s does nothing with it and it is up to cluster administrator.

So, my questions are:

  1. Is this issue still open? If so what is missing?
  2. Has there been any other discussions on how to handle the Cloud Vendors that currently support the loadBalancerIP field of a service?

On 2, I'm happy to create a new issue if it is off topic but curious to see if there was any thought put into this.

@github-actions github-actions bot removed the stale label Jul 10, 2023
@tommie
Copy link
Contributor

tommie commented Jul 10, 2023

Looking at the description, it seems like this PR is about EG reading Service.status to update Gateway.status.addresses, but I took it to mean the full chain Gateway.spec.listeners.addresses -> Service.status -> Gateway.status.addresses, since only doing the latter wouldn't help anything. I feel this is done, but my bare-metal use-case is probably uncommon (and there is #1035).

If there's an issue with Service.status.ExternalIPs, then EG is probably setting it even for LoadBalancer services, which it probably shouldn't, as discussed: #1035 (comment). #1463 was related to that discussion. The question is if

serviceSpec.ExternalIPs = r.infra.Addresses
should only be for type not being LoadBalancer.

I think (2) would be a different question.

@arkodg
Copy link
Contributor

arkodg commented Jul 10, 2023

@LanceEa Id prefer if we close this issue and create a new one, if we believe the feature has not been implemented correctly.
Here is the current implementation

@arkodg arkodg closed this as completed Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request provider/kubernetes Issues related to the Kubernetes provider
Projects
None yet
Development

No branches or pull requests

7 participants