-
Notifications
You must be signed in to change notification settings - Fork 512
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
Define how to reflect partial validity of routing rules in the HTTPRoute status #1696
Comments
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I have a strong inclination towards a fail-fast mentality here, don't allow any "partially invalid states". We should discuss this one at the next sync. Also, @robscott and I want to consider this a release blocker for GA for now, as it would be quite ideal to resolve this prior to v1. |
Copying my comments from meeting chat with some edits here: Insofar as we need to choose some level of granularity to start discarding invalid configuration, object-level (discard every rule in the HTTPRoute if one is invalid) does at least feel like the most natural option in Kubernetes. Discrete objects applies universally across all kinds of resources, so it's easier to form a consistent mental model around that than having to think about the internals of each individual kind of object. What @robscott said in today's weekly meeting around "don't collocate all your rules in one HTTPRoute" is reasonable guidance to make that less painful, though it has some other concerns around how you arrange configuration that has like needs across configuration that must across all rules in the object (e.g. Kong's plugins apply to every rule in Ingress because they're set via annotation). Templated config could help manage that buuuuuut nobody really likes templating their config: it's powerful, but not that fun to manage. Object-level is also consistent with the behavior of a validating admission webhook, and ideally most rejections would happen there, since rejecting configuration has a lower blast radius (none, really) than accepting it and maybe deleting nearby configuration depending on the exact implementation behavior. |
if the name field is added to a routing rule (#995 ), perhaps a way to report partial validity could be extend status to support per rule validation? |
Going to unassign myself from this one, the addition of a PartiallyInvalid condition was nixed and part of that was included in #2150 |
Talked about this with @shaneutt and @youngnick a bit today as we were working through the GA project board. Here's a summary: We're uncomfortable with leaning too much into supporting large Routes. While concepts like per-Rule status conditions could be helpful long term, we're not convinced that they're necessary quite yet and a bit worried that they would further encourage the usage of large Route resources. With that said, even relatively small Routes with 2 separate Rules could run into this state, so we need at least some rudimentary way to communicate this. We also have to recognize that stating that controllers can support partially invalid Routes has some risks. For example, if a rule with a There are also legitimate arguments in favor of other approaches: 1. Fail fast 2. Revert to last known good state With all of that said, there are likely many cases where it makes sense for a controller to support a partially valid Route (where a subset of Route rules are invalid). We think the most straightforward way to represent that state would be with a new Given the discussion above, I don't think we need/want to be prescriptive about whether implementations should support partially valid Routes, since each implementation will have different considerations here. Instead, it may be sufficient just to provide a standard way for implementations to represent this state when it occurs. |
I agree here, except for one part:
If we allow anyone to support partially valid Routes, then everyone has to support them, otherwise we're going to end up with very subtle and difficult to test implementation differences. If I move a set of resources from a GatewayClass that supports partial validity to one that doesn't, what happens? To explain this better, let's walk through the case that we do allow implementations to differ on whether they support partial validity or not, that makes partial validity an Extended feature, that we will need to write conformance tests for. Personally, the thought of having to write a suite of conformance tests that would test both cases makes me want to curl up in a ball and hide. But it is a thing we could do - as long as we are cognizant of the costs. Mandating one option at least means that we only have one set of conformance tests to write, rather than two. But we'll need conformance tests for whatever we choose anyway, sigh. |
I still think we could come up with some (possibly a bit contrived) examples of when allowing partial would go bad, particularly if the different rules relate to each other. One scenario floating around in my head, is what if the One thing seems entirely certain to me: |
/assign |
I think this may not be that problematic in practice - the main use case I see for allowing partially invalid states is reducing the blast radius of applying bad config in stateless controllers. Checking to ensure no resources are in a partially invalid state before migrating feels reasonable, as does completely rejecting partially invalid routes when migrating to a new controller if partial validity is not supported, given that feels like an action unlikely to be made on a whim in a production environment. |
What would you like to be added:
If we have an HTTPRoute resource with some if its routing rules valid, some -- not valid (for example, PathMatchType in HTTPPathMatch is not one of Exact;PathPrefix;RegularExpression), define how to report that in the HTTPRoute status.
Why this is needed:
Current documentation is a bit contradictory:
The HTTPRoute docs say:
However, in GEP-1364, it is mentioned:
This comes from #1674 and a discussion on Kubernetes Gateway API Slack sig-network-gateway-api https://kubernetes.slack.com/archives/CR0H13KGA/p1675122817360569
The text was updated successfully, but these errors were encountered: