-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove Host matching for RouteRules #1116
Conversation
Inside the cluster it's common to make a request to a service using a service's short name. For a service name foobar, you can make a request for http://foobar/. Istio RouteRules effectivly intercept traffic destend for one Service and route it to another Service. Within the RouteRule, a filter can be applied based on the HTTP Host header. If the header is not matched, the rule is not applied. A Knative Route sends traffic destend for a single Service (fronted by an Ingress) to another Service backed by a Revision. The Ingress already applies Host based routing, the RouteRule also applying Host based routing is at best redundent. With the new Eventing Channel work, we'd like to be able to send requests from inside the cluster to a Route, utilizing the RouteRule. Currently, these requests are dropped because the request inside the cluster is made to the service hostname and not the external fqdn. Unless there is a reason to keep the redundent Host matching, I'd like to drop the matching on the RouteRule so that traffic from inside the cluster can easily be routed.
I'm curious what happens if an internal service uses the external domain to contact another internal service. Does that even work today? Would it work after this change? Note that Istio recommends using fully qualified (internal) destination names to avoid namespace ambiguity:
From https://istio.io/docs/reference/config/istio.networking.v1alpha3/#Destination |
@grantr I tried using the fqdn for the Route (
I read the same docs and took it to mean a name like |
I have tried to remove the host constraint from RouteRule locally. But actually I still couldn't successfully send request to the service fronted by Ingress (i.e. the placeholder service) after removing the host constraint. My personal understanding is that the placeholder service is not backed by any proxy. So there is no receiver for the requests sent to the placeholder service. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: scothis Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ZhiminXiang good catch. The issue was that the empty Match struct was still present for the RouteRuleSpec. I made the type a pointer. edit: I spoke too soon, there is still something blocking requests from inside the cluster. |
@scothis: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Digging a bit deeper, there is still an issue targeting a service backed by a RouteRule from inside the cluster. I have successfully targeted a service backed by a RouteRule before. Either I'm missing something simple, or this functionality changed between Istio 0.6 and 0.8. Creating the equivalent service backed by an equivalent VirtualService works. |
Superseded by #1047 |
* Add automated branch cut script * Tweak create-release-branch.sh and fix mirror-upstream-branches.sh * Fix typo
Inside the cluster it's common to make a request to a service using
a service's short name. For a service name foobar, you can make a
request for http://foobar/. Istio RouteRules effectively intercept
traffic destined for one Service and route it to another Service.
Within the RouteRule, a filter can be applied based on the HTTP Host
header. If the header is not matched, the rule is not applied.
A Knative Route sends traffic destined for a single Service (fronted by
an Ingress) to another Service backed by a Revision. The Ingress already
applies Host based routing, the RouteRule also applying Host based
routing is at best redundant.
With the new Eventing Channel work, we'd like to be able to send
requests from inside the cluster to a Route, utilizing the RouteRule.
Currently, these requests are dropped because the request inside the
cluster is made to the service hostname and not the external fqdn.
Unless there is a reason to keep the redundant Host matching, I'd like
to drop the matching on the RouteRule so that traffic from inside the
cluster can easily be routed. Host matching will still occur at the
Ingress.
Release Note