-
Notifications
You must be signed in to change notification settings - Fork 303
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
Option to share LB between Ingresses #369
Comments
@GGotardo What's preventing you from just giving the ingress in "app-2" namespace a different static-ip? The ingress-gce controller has no easy way of knowing that you wan't both those ingresses to have the same static-ip. Even if it did, the fact that Ingresses are namespaced means that the controller must respect this separation. |
Actually that's not a problem for me, and this is the way I'm doing on GCP, because I have a small development cluster, but I could have a big cluster with many namespaces. So I need 1 LB and 1 static IP for each one of them. Thinking on GCP Load Balancer, it could be resolved with a single one and multiples backs/fronts. Is ingress-gce responsible for creating Load Balancers once I create an Ingress Service? |
Yes, ingress-gce is responsible for creating the LB resources given an Ingress specification. I see your point but like I said before, this is a very ugly problem to solve in the ingress-gce controller. My suggestion would be to either condense the amount of namespaces you need or have enough static IP's available. Regardless, this is an interesting use case so I'll leave this open as a feature suggestion. |
/kind feature |
It's not a rare use case in a large shared k8s cluster (L1/L2 GFE are doing the same). For our case, different teams may use their own namespaces to manage their deployments and services. It shouldn't be their problem to manage things like public DNS setup, TLS termination, cert renewal, etc. It's also worth mentioning that this is already supported by many other ingress controllers, eg. traefik, nginx. Though, I don't like the idea of putting a L2 SLB behind the GCLB. A workaround I can think of would be adding a custom resource type, say |
This is a feature we also want. Currently we use a mix of nginx controller and gce controller. High volume service gets their own GCE LB, while normal services uses a shared nginx LB. |
Another vote for this feature. Another use case is highly dynamic test environments where a new deployment (with ingress) on a per pull request basis is created. It would be very nice if the kubernetes ingress controller for gke would work with multiple ingress resources on the same IP. This way we can define a wild card dns entry that points to this loadbalancer and it would then have paths/hostname mappings based on these individual ingress documents. This is what we do today with the nginx ingress. |
Recombining multiple ingresses into one load balancer is something nginx ingress already does and would be extremely useful to have for GCE ingress as well since it allows applications to set themselves up as backend for a particular route, while keeping their manifests otherwise independent from the other application. This would look like
I assume implementing this leads to questions about a lot of edge cases and on how to stay within the limits of the url map, but in general it's something like 'If it shares hostnames combine them into one load balancer.' |
If someone wants to tackle this, we will happily accept an implementation. Keep in mind though that this is a messy problem to solve in the code. /good-first-issue |
@rramkumar1: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'd like to dive into this issue. |
@pondohva Great! Looking forward to the PR. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
We are creating a namespace per dev branch and exposing this to the net. We would like to keep the simplicity of a gce ingress. We will run in a quota (money) issue on gcp. A shared ingress would prevent us from using another ingress controller. |
Hi, buddies. If someone else has any idea or approach I will appreciate that. |
Taking advantage, lol.
|
This is what we're currently dealing with as we're using multiple Helm Charts that each have their own ingress definitions, but we want to combine them under one domain, separated by path. Is there already a workaround here? edit:// We don't need namespace separation |
I +1 this issue. We work in a namespace-per-app environment and recently we have hit a limit of 1000 forwarding rules. The solution would be to either aggregate our namespaces (which would be kind of hard for us, given the number of workloads), create another cluster in another project or use ingress-nginx (which means we would lose the benefits of the managed L7 LB). |
We currently have on-prem clusters and considering a move to GKE. Using nginx-ingress we have wildcard dns for our domains to allow developers to choose subdomain or context path in their ingress without any other configuration involved. Not being able to reuse an ip-address across ingresses seem to increase complexity by quite alot. Hoping for a solution to this. |
@blurpy There's nothing preventing you from using nginx-ingresson GKE to do this today. The nginx-ingress controller will allocate a single GLB with a single public IP address. Set your DNS as a wildcard to to this IP address. Your developers can create as many ingress resources as they want, which can all share this IP address. |
Thanks, good to know. I was hoping to use the managed part of GKE as much as possible though, so I'm still hoping for an improvement here. nginx-ingress is a nightmare for both ops and devs because they don't care about backwards compatibility. |
I struggle to understand why GCE ingress is still not in parity with other ingress controllers as of 2020. This is a very desired feature in our workflow as including an ingress as par if a Helm Chart gives a lot of flexibility. Looking forward to the combined power of GLB and incremental ingresses. |
Oh, sorry.. seems like i dont got the hole thread.. lol |
https://github.com/jakubkulhan/ingress-merge My use case is a slight variant: several |
Any steps on installing without Helm? I'm just using GHActions to do a |
Also the fact that AWS implemented this already.... kubernetes-sigs/aws-load-balancer-controller#298 (comment) |
This workaround/setup with traefik works for us (nginx setup has issues, as described above). Install traefik:
Rest of the objects without helm. N.b. you need to allocate the IP address
The individual Ingress resources are annotated with
... to make traefik process them. |
Looks like this issue has been up for a long time. Anything I can do here? |
On a slightly related note: we are now working on our own MultiCluster LB controller that will utilize 2 or more existing LBs created by 2 different Kubernetes clusters that will merge the two URLMaps and create BackendServices with global Backends (instance groups from all clusters). For us this is the easiest way, and cheapest (no Anthos Hub, as we don't need most of Anthos's features). This controller would be similar to one that can create one LB from multiple Ingress resources, though simpler. |
+1 for this feature. |
Are there any updates on it? |
Seems like its coming with API-Gateway. A replacement for ingress: #973 (comment) |
I didn't get this to work with traefik, since it 404's on '/' for me. It has a '/ping' route that'll 200, but that's on a different port, and I couldn't finagle BackendConfiguration to get the health check to work. But I did get nginx to work. It has a default backend option that'll return a 200 to '/healthz' so that'll work for the health check.
And then you can create a ManagedCertificate and an Ingress for But in the end it doesn't really solve the underlying problem. Sure, it lets us create separate Ingress's for foo and bar, but we have to list the certificate names in the annotation on the loadbalancer ingress, so it's not significantly more convenient than putting all the ingresses into a single manifest. |
@bryanlarsen you can use the GCLB in L4 proxy mode and terminate tls on the nginx ingress, and instead of using google managed certificates have them automatically created by cert-manager. This would allow you to have services which are fully specified independently of one another and avoid having to modify a shared resource when adding/removing services exposed to the outside world. With nginx ingress you also get more flexibility as you can route based on host name etc, whereas GCLB can only route based on path |
@adrian-gierakowski this is for a situation where cert-manager cannot be used due to cert-manager/cert-manager#3717 |
@bryanlarsen you could try https://github.com/caddyserver/ingress |
I want to use IAP for multiple ingresses (multiple namespaces) on the shared LB. |
I would take a look at https://cloud.google.com/blog/products/containers-kubernetes/new-gke-gateway-controller-implements-kubernetes-gateway-api for a multi-role use case |
I didn't realize they had a pre release version available?!?!?! ive been waiting for years @bowei thanks for sharing! |
I cannot believe gce is the only one who does not support this yet... |
any updates here? |
it's strange that at the end of 2021 there is no way to share LB between Ingresses ... |
@CarpathianUA was just about to comment the same thing yesterday. Supposedly the new gateway API would help with that. But it's not available with GKE Autopilot. |
This is a limitation of the Ingress API. The Gateway API allows for this feature and we will look to support this feature there. |
@swetharepakula how is this completed? Also what is the limitation of the ingress api? Nginx ingress supports multiple ingress objects controlling a single gateway |
I think the more accurate explanation is that it's a limitation of the GCE implementation of the Ingress API. |
The Ingress API does not natively support this. A single Ingress is meant to represent a single load balancer. Nginx is completely different architecture and what works there does not necessarily work for ingress-gce. In ingress-gce, we have many other concerns such as namespaces, permissions etc that cannot be expressed clearly in the Ingress API. This feature is one of the core reasons the Gateway API was created. The Gateway API will allow a single LB to be shared and has the necessary permissions and namespaces pieces built into it. This feature will be supported through the Gateway API, but we will not be adding it to Ingress. @adrian-gierakowski , I was not aware Github had different close options. I will close this as not planned. |
@swetharepakula thank you for the clarification 👍 |
I want to organize my cluster into multiples namespaces (app1, app2) and work with Ingress to access each of them. Something like:
But when I try to do so, the following error is showed while creating the second Ingress:
It tries to create another LB, but it should share the same one, just creating new backends/frontends.
The text was updated successfully, but these errors were encountered: