-
Notifications
You must be signed in to change notification settings - Fork 487
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
BackendPolicy: allow global/namespace level defaults #583
Comments
Thanks for starting this discussion @howardjohn! As far as creative uses of BackendPolicy, I don't think there's much right now that would prevent this from happening (there's no min length on BackendRefs). I think the options you've mentioned above could be roughly split into these 3 options:
So far we've said that only a single BackendPolicy can apply to a request. This would likely need to change if we added the ability to provide defaults at additional levels unless the policy resources we were attaching were something other than BackendPolicy. To really have a solid answer here, it would be helpful to start filling out BackendPolicy with more content to see how broadly it applied. My hunch is that we'd want to attach different kinds of policy at different levels. If we end up with sufficiently generic policy, I think 3 becomes very compelling. |
A thing to note is that we could leave some of this to be implementation specific for the moment while collecting experience across implementations. Nothing prevents implementations from giving unattached BackendPolicy (and friends) resources special meaning if defined in specific namespaces. |
Yeah I agree that this is a good time for experimentation. All of the options above are completely possible today without an API change. It would be good to see what works or doesn't work in practice before we lock down the spec too tightly. |
Oh neat, I didn't realize backendRef allowed 0 length list. That seems reasonable for now. I do worry a little bit if we have implementations experimenting a lot now we may end up with lots of divergence that is never reconciled - maybe this can be addressed by good conformance tests post-alpha/beta |
@howardjohn I've been thinking a lot about how to apply Namespace-level default or enforcement with the ServicePolicy proposal in #611. At first I thought that Namespace-level policy was incompatible with ServicePolicy because ServicePolicy depends on a strict hierarchy between resources to have predictable and enforceable override behavior. However, I realize that we can simply add Namespace into this hierarchy and voila! As a part of Gateway API (and in the definition of ServicePolicy), we would specify a strict hierarchy of resources:
Here's what's going on in this diagram:
Now it may seem a little strange that Namespace is at the top of the hierarchy when GatewayClass is a non-Namespaced resource, but I think this model still works out. Check out this diagram:
Let me know what you think about this and whether you feel it addresses the "global defaults and enforced policies" problem. |
I think it makes sense, but I am not sure I understand why Namespace is above GatewayClass? That means the cluster admin cannot enforce any policies, since namespace admins can override? |
We could choose to rearrange it so that the hierarchy has GatewayClass -> Namespace -> Gateway. I think there are good arguments for both orders. Ultimately, my guess is that the same administrator would have ownership over GatewayClasses and Namespaces, so they could choose either vector to enforce policies. It all depends on whether enforcing via a GatewayClass or Namespace has simpler UX for enforcing org-wide policies. I personally think that Namespace is a little more natural (and has more precedence) which is why I started with Namespace at the top of the hierarchy. The Namespace policy doesn't actually directly affect the GatewayClass. The Namespace policy only takes effect when a given Gateway is deployed into a Namespace. There is definitely some weirdness though when Gateways and Routes are in different Namespaces. You would have a Namespace policy that applies to a Gateway in that Namespace which also applies to Routes which are bound from different Namespaces. We'd have to think through how this would work and whether a local Namespace policy would override the Gateway's Namespace policy. |
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. |
I think this can be closed once #713 is implemented. |
I think so too. |
@hbagdi: Closing this issue. In response to this:
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. |
Currently, BackendPolicy refers to an explicit set of backends. It has been a common demand for us to configure things like retries and timeouts (which, presumably, will be part of BackendPolicy in the future) at a higher level. For example, if a user wants to enable retries on all requests globally, they don't want to do this in 1000s of BackendPolicies and instead want a single point of control.
The request here would be some way to apply BackendPolicy to a large scope. This could be global or namespace level.
Some possible options. I don't think any of these are fully refined:
The text was updated successfully, but these errors were encountered: