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

Cross namespace communication in GKE ingress #89917

Closed
ankita-1420 opened this issue Apr 7, 2020 · 14 comments
Closed

Cross namespace communication in GKE ingress #89917

ankita-1420 opened this issue Apr 7, 2020 · 14 comments
Assignees
Labels
kind/support Categorizes issue or PR as a support question. sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@ankita-1420
Copy link

Hey @liggitt,
We have two different applications deployed in two different namespaces in GKE, I am trying to expose these applications using GKE Ingress which is in the default namespace.
I have SSL certificates for this applications.

The issue we are facing now is external load balancer is not able to communicate with our applications because the namespaces are different.

Referring to issue no #17088 I found that Nginx ingress can be used in this case, but my use-case restricts use of Nginx or any third party tool, Hence can you help me to find a solution or any work-around for this using GKE ingress only.

@ankita-1420 ankita-1420 added the kind/support Categorizes issue or PR as a support question. label Apr 7, 2020
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Apr 7, 2020
@athenabot
Copy link

/sig network

These SIGs are my best guesses for this issue. Please comment /remove-sig <name> if I am incorrect about one.

🤖 I am a bot run by vllry. 👩‍🔬

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 7, 2020
@athenabot
Copy link

/triage unresolved

Comment /remove-triage unresolved when the issue is assessed and confirmed.

🤖 I am a bot run by vllry. 👩‍🔬

@k8s-ci-robot k8s-ci-robot added the triage/unresolved Indicates an issue that can not or will not be resolved. label Apr 7, 2020
@ashutoshgngwr
Copy link
Contributor

Create the Ingress resources in same namespace as the Service resources and the ingress controller should be able to pick it up. Ingress resources and controller need not be in the same namespace.

https://github.com/kubernetes/ingress-gce/blob/master/docs/faq/README.md#are-ingress-controllers-namespaced

@rikatz
Copy link
Contributor

rikatz commented Apr 16, 2020

/assign @bowei

@athenabot
Copy link

@bowei
If this issue has been triaged, please comment /remove-triage unresolved.

If you aren't able to handle this issue, consider unassigning yourself and/or adding the help-wanted label.

🤖 I am a bot run by vllry. 👩‍🔬

@bowei
Copy link
Member

bowei commented Apr 30, 2020

/remove-triage unresolved

@k8s-ci-robot k8s-ci-robot removed the triage/unresolved Indicates an issue that can not or will not be resolved. label Apr 30, 2020
@bowei
Copy link
Member

bowei commented Apr 30, 2020

This is by design, the Ingress object can only target services in the same namespace.
We have been exploring changing this in the service-apis work (which is work in the sig on a redesign of Ingress + some aspects of Service).

https://github.com/kubernetes-sigs/service-apis

@bowei
Copy link
Member

bowei commented Apr 30, 2020

Reading through your bugs, I want to clarify that "is not able to communicate" means:

  1. you can't write a config to do this.
  2. you have a config, but the traffic cannot reach your application.

If this is 1. then this is part of the API, if it is the case for 2., then if you can post an anonymized version of your config, it would be great.

@thockin
Copy link
Member

thockin commented May 14, 2020

Ping @ankita-1420

To echo Bowei - the Ingress API intentionally does not cross namespaces. If you REALLY need to do that, you can maybe use the service-NEG controller and link the NEGs together manually though an HTTP LB directly?

@thockin thockin closed this as completed May 14, 2020
@ashutoshgngwr
Copy link
Contributor

Ping @thockin @bowei

In case someone else wanders here with a similar issue. Another solution could be to create a service of type ExternalName in the same namespace as the ingress resource. The said ExternalName service could point to the FQDN of any service in another namespace.

@Berndinox
Copy link

@ashutoshgngwr i was not able to use ExternalName, because:

Translation failed: invalid ingress spec: service "ingress01/ing-web01" is type "ExternalName"
, expected "NodePort

do you have any working examples onto this? Thanks

@ashutoshgngwr
Copy link
Contributor

@Berndinox It was more of a hypothesis than a solution. Looking at the error message, it looks like that I was wrong.

@Berndinox
Copy link

Hej, thanks for answering. So that's bad news.
Seems like there is no "clean" solution available yet.

Just:

someone finds another solution?

@bvarga
Copy link

bvarga commented Mar 7, 2022

gateway-api is in preview for gke, see:

https://cloud.google.com/kubernetes-engine/docs/concepts/gateway-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

No branches or pull requests

9 participants