-
Notifications
You must be signed in to change notification settings - Fork 484
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
Conflicting SNI's between HTTPRoute & TLSRoute #623
Comments
At any time, a listener on the Gateway can only select routes of one |
I thought you could duplicate listener ports in a Gateway and then the controller should collapse them:
I guess we can apply the same conflict logic within the same type (e.g. HTTPRoutes), but do across types which would make the behavior consistent in a way, but would need to raise a condition on the object to alert the user. // ref: https://gateway-api.sigs.k8s.io/references/spec/#networking.x-k8s.io/v1alpha1.Gateway |
I see the problem.
I think the |
Today Contour supports a single insecure/secure listener, so all traffic routes through those two listeners essentially. Someone could potentially create a TLS route with the same fqdn as an HTTPRoute and you'd have a conflict. We handle this today by only supporting one or the other if users create them on the same fqdn. |
IIRC an implementation can either conflict the route on this, or could choose HTTPS (on the principle that most specific wins). |
TLSRoute implies that the traffic flowing through the byte stream could be non-HTTP. Can you multiple HTTP/non-HTTP traffic on the same TCP port via Contour? Only then can this conflict occur.
@jpeach, is such a conflict even possible though? |
No you can't, but if someone tries to configure this, there should be some set of conditions to warn them that one was rejected and the other is used. I was just trying to think through what should happen in that case, which resource "wins" and what conditions to set so the user is aware of what's happening. |
In that case, shouldn't there be a conflict of listeners error on the Gateway status? Let's say we have the following: listeners: # Use GatewayClass defaults for listener definition.
- protocol: HTTP
port: 80
routes:
kind: HTTPRoute
- protocol: TLS
port: 80
routes:
kind: TLSRoute In this case, shouldn't the controller signal an error on the Gateway resource stating that these two listeners are incompatible? |
Sorry @hbagdi I feel like I haven't been super clear. I agree with you on that this should be an error but trying to understand who would win in this case? Do all the corresponding routes that are selected by these two listeners get rejected? If the HTTP listener was valid and the TLS was added, what should we do? I'm not sure if there are any good rules to apply short of rejecting both, but worry that you'd drop all traffic in this case. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
To summarize my interpretation:
You end up with both an HTTPRoute and a TLSRoute binding to the same hostname (i.e. SNI name).
So the spec claims that this ought to be OK (the rationale is that you can still route properly based on the TLS SNI). However, there's no language that prevents an implementation rejecting this configuration though (it's stated as "an implementation might", not MUST). So I can think of 3 options:
|
Catching up on this one, I think @jpeach has nailed this, and I think we should do his option 2 above. |
I think option 1 may be preferable/simpler to handle. I can't think of a use case where you'd want an HTTPS and TLS listener for the same hostname on a Gateway. If users attached different certs to each listener it could get especially difficult to implement. It seems significantly simpler to me to consider that invalid. |
I may be missing something but seems like 1 and 2 are the same? Or is the difference just rejecting the listener vs rejecting all routes on the listener? If the latter, I slightly prefer 1, seems a bit simpler. I agree (3) could be done but seems a bit complex and not likely portable, so I would prefer to defer it (likely indefinitely) |
Yeah, my interpretation was that 1 would reject the entire listener instead of just specific routes. That would be my preferred option. |
I think 1 is fine too, and agree that it is simpler. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/lifecycle frozen |
Since the problem here comes up in conflicts between |
Since We want to promote TLSRoute for 1.2, I'm adding this to the Said that, I lean toward solution 1, for its simplicity. |
Does anyone have capacity for this one? Should we sync about the future plans for TLSRoute soon to make sure we're all on the same page? |
I think we should talk more about TLSRoute as part of scoping for 1.3, once 1.2 is released, yes. |
What happened:
If I have the same
fqdn
defined in both anHTTPRoute
as well as aTLSRoute
, what could the conflict resolution be in that case?The current docs on a
TLSRouteMatch
sort of lead me to think that TLSRoutes should match first before HTTPRoutes, but might be nice to raise a Condition for this in the event that one is ignored over another.Just curious if others have thought about this yet or if I'm maybe misunderstanding the spec. =)
The text was updated successfully, but these errors were encountered: