Hi
I have succcessfully tried kongs ingress controller , but, I wasn’t able to find any documentation nor examples of how to use path based routing with the ingress controller? Does this mean it is not supported and that you must use Host header?
In my case, we (the company I work for) have a hosting solution where we don’t wan to expose any information about our internal hosts to our customers. Therefore we have used path based routing so far, but, this door seems closed with the ingress controller?
Does this mean it is not supported and that you must use Host header?
Kong Ingress Controller follows the Ingress Spec of Kubernetes, which allows you to route your traffic based on HTTP Host header and HTTP path. So, it will be possible for Kong Ingress Controller to route your traffic based on path.
Having said that, there is current one limitation in Kong Ingress Controller that you might be running into.
You can use path based routing but you’ll need to specify the Host header in addtion to your path.
Please checkout an example in our getting started guide.
In my case, we (the company I work for) have a hosting solution where we don’t wan to expose any information about our internal hosts to our customers. Therefore we have used path based routing so far, but, this door seems closed with the ingress controller?
I recommend you to create Ingress rules with Host that is public and then use path based routing to break traffic up and send it to different services upstream.
Can you clarify how one would go about adding the host header for a given path?
I have created an ingress for a service (service.foo.bar) and I want it to be accessible through api.foo.bar/service so my understanding is that I should then create an ingress for api.foo.bar and add the path /service, but I’m unsure how I can set the host header service.foo.bar for the path /service
Do you specifically need that host header?
Creating the following ingress will actually configure Kong to route the requests to your upstream. It is currently not possible to alert the host header that Kong Ingress uses for upstream calls.
From what I had gathered from the documentation was that I was supposed to create ingress for each service (host:service1.foo.bar, host:service2.foo.bar etc) and didn’t know how to front those services with api.foo.bar and have the service accessible through api.foo.bar/service1 using the ingresses.
Then I figured out that I could use the same host for multiple ingresses which solved my case
I have 2 different domains for 2 different namespaces
host 1 : dev.example.com mapped to dev namespace
host 2: qa.example.com mapped to qa namespace
and there is service1 in both of them
When I am accessing dev.example.com/service1 it is rendering correctly
But when I am acessing qa.example.com/service1 it is rendering dev service1 pages and not qa ones .
Could you please help @hbagdi