Knative routing of cluster local host names does not match k8s dns behavior #13513
Labels
area/API
API objects and controllers
area/networking
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
triage/accepted
Issues which should be fixed (post-triage)
Milestone
In what area(s)?
/area API
/area networking
What version of Knative?
Expected Behavior
Assume that the foobar service is deployed to the baz namespace, and we are trying to call foobar from another pod in the baz namespace. Calls of the form
curl foobar
should work with knative, the same as with a normal k8s Service, which will automatically route tofoobar.baz
.Actual Behavior
A 404 error is returned, as the service cannot be routed. Calls with the namespace included like
curl foobar.baz
will work as expected. This appears to be due to the way the Istio Gateway, VirtualService, or KIngresses are configured.This should at least be documented since it breaks the notion of Knative hiding Kubernetes abstraction details. It's not clear to me if this is easy to fix, since the gateway would have to know or discover the namespace of the client. The workaround is to change all clients to use the hostname with a namespace.
For users that are migrating existing K8S services to Knative, this can be a surprise since foobar.baz and foobar.baz.svc.cluster.local work normally.
Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: