Kubernetes default backend should work #1073
Labels
area/provider/k8s/ingress
kind/bug/confirmed
a confirmed bug (reproducible).
status/5-frozen-due-to-age
What version of Traefik are you using (
traefik version
)?v1.1.2
What is your environment & configuration (arguments, toml...)?
traefik.toml:
What did you do?
I'm trying to set up a Kubernetes ingress that matches all subdomains of my cluster's TLD that don't have other ingresses with an explicit host match. For example, if I have an ingress for the host "foo.example.com", then I want to send requests for that to service "foo". But if a request comes in for "bar.example.com", or any other subdomain that doesn't have its own ingress, I want the request to go to a default backend "catchall".
This is what I tried originally:
After creating this ingress, the Traefik dashboard shows one frontend for ".example.com" with route ".example.com" and rule "Host:.example.com". One backend for ".example.com" shows up with all the correct endpoints for the "catchall" Kubernetes service. However, I get a 404 when making a request that I'd expect to work:
$ curl -i https://bar.example.com/ HTTP/1.1 404 Not Found Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Thu, 26 Jan 2017 23:07:21 GMT Content-Length: 19 404 page not found
I then tried an ingress using a default backend, which should do what I want, according to the Kubernetes documentation:
But this results in no frontends or backends showing up in the Traefik dashboard.
Finally, I tried a variation of the first ingress, but left out the host:
The Traefik dashboard shows an unnamed frontend with an empty route and an empty rule. An unnamed backend shows up with all the endpoints for the "catchall" Kubernetes service. My test request then works as I'd expect:
$ curl -i https://bar.example.com HTTP/1.1 302 Found # ...
Is it intentional that the first two ingresses I tried didn't work as expected? Am I misunderstanding something? Or is this a problem with Traefik and/or Kubernetes? Thanks very much!
The text was updated successfully, but these errors were encountered: