1

Infra - GKE I have two version of service running on different namespace

 - web1 - namespaceA
 - web2 - namespaceB

Is it possible to have single gke ingress and use it to route traffic to both the services.

/web1 --- goes to web1 - namespaceA
/web2 -- goes to web2  - namespaceb
pythonhmmm
  • 833
  • 1
  • 18
  • 38
  • 2
    No. Kubernetes Ingress can only route to other services within the same namespace. You have to find a hacky way to do this. This type of use case goes against what "namespaces" are meant for in Kubernetes (isolation). – ahmet alp balkan Jul 31 '20 at 04:54

1 Answers1

1

Solution A

This is for nginx-ingress

ref: https://stackoverflow.com/a/59845018/3854890

Solution B

GKE Ingress in namespace A-> Nginx service in namespace A

with nginx.conf like:

    location /web1 {
        proxy_pass web1.namespaceA
    }
    
    location /web2 {
        proxy_pass web2.namespaceB
    }
RammusXu
  • 1,180
  • 1
  • 7
  • 21