Project request quota admission control#6768
Conversation
There was a problem hiding this comment.
Is this going to be shared?
There was a problem hiding this comment.
It is... same cache used in the other project admission control plugins
6f6bfc7 to
591cbd4
Compare
|
updated package name |
|
[test] |
|
unit test failures |
|
@deads2k I thought we were wondering if we even needed this. Did you resolve that we did? |
There was a problem hiding this comment.
Don't you need to find all the limits that apply and take the min (or the max, not sure which direction we'd go)
There was a problem hiding this comment.
Not sure that we have a use case for that or that selectors are going to be that complex. Right now it's relying on the order of selectors in the config and, for what we want this for, imho it's sufficient.
There was a problem hiding this comment.
If I apply a limit based on label selection, I'd be surprised if it didn't take effect. I think we should pick a direction (either max or min of matching limits), iterate to determine that limit, and document which direction we chose. I think I would tend toward taking the max (just like policy... you can do something if any of your roles allows it).
There was a problem hiding this comment.
If I apply a limit based on label selection, I'd be surprised if it didn't take effect. I think we should pick a direction (either max or min of matching limits), iterate to determine that limit, and document which direction we chose. I think I would tend toward taking the max (just like policy... you can do anything allowed by any policy grant).
I prefer first one wins. Otherwise we'll pick a direction and not like it. I think its more likely that I know which labels have priority over which other labels and build my config file that way.
There was a problem hiding this comment.
Not sure that picking the direction would alleviate the problem of having a limit not apply. Suppose we say max wins, and we have a very general rule that gives you a max of 100, and we add a more specific selector with a max of 5. Your more specific rule would never apply. Suppose we say min wins... then we can't easily configure something like the online use case where we want the default to be 1, but only for certain users increase that limit to 100. The more selective limit would never apply.
There was a problem hiding this comment.
I prefer first one wins. Otherwise we'll pick a direction and not like it. I think its more likely that I know which labels have priority over which other labels and build my config file that way.
I could buy that. It would also let you restrict specific users while letting everyone else have a higher limit.
|
Also, this doesn't solve the issue with a lagging store allowing a few requests through until it catches up |
Can you think of a way to mitigate this? |
There was a problem hiding this comment.
isn't the yaml for this level: platinum?
There was a problem hiding this comment.
fixed. Oddly it worked with either form.
Not without recording the update somewhere that would generate a conflict (like an annotation on the user), and having a reconciling controller to sweep and fix the annotation if it got out of sync (like resource quota)... not sure I like something that complex for this |
591cbd4 to
7e9a2f7
Compare
|
Added requester index to project cache |
dd62f15 to
a8257c7
Compare
We could work around it, but since this is has general utility (its commonly requested), useful for us, and relatively small it seemed better to bring it in. |
|
[test] |
|
You could require an atomic mutation on the user in order to allow it. You On Fri, Jan 22, 2016 at 10:20 AM, Cesar Wong notifications@github.com
|
|
I'm tempted though to say that since we're paying the price of the project On Fri, Jan 22, 2016 at 11:29 AM, Clayton Coleman ccoleman@redhat.com
|
@smarterclayton how can I do this? |
|
Since we don't have post admission control yet (as @derekwaynecarr has floated) the current solution is fine, assuming a) the leak window is minimal even if an attacker is blowing up the server and b) you have a corresponding controller that goes and fixes up projects that are out of band (i.e. the oldest projects are set to zero quota). The controller can be post 3.2, but it's essentially quota reconciliation and needs to tie in with the proposed organizational quota constraint. |
|
Sounds good to me |
|
Do we ever plan on letting users organize their projects via labels? If so, would we basically have to no longer treat a Project as a virtual resource? Or would we store the project labels as annotations on the Namespace and then update the strategy code to pull a Project label from the annotation instead of the normal location? I guess the latter would make sense but it would be nice to have a plan... |
There was a problem hiding this comment.
Glad we went with this approach. :-)
There was a problem hiding this comment.
I like it too :) Allowed us to remove the embarrassing hack that merged the openshift and kube clients. Thank you for suggesting it.
|
@deads2k @liggitt @smarterclayton Is the way that this plugin is configured (via user labels) ok? Do you have any suggestions for changes? Writing doc for it :-) |
pkg/cmd/server/api/latest/helpers.go
Outdated
There was a problem hiding this comment.
Add a TODO. This should go away once we have the yaml serializer in the rebase after this one.
I like using labels on users for it. |
949ce7a to
29444e9
Compare
|
Addressed comments so far |
|
@ironcladlou ptal |
There was a problem hiding this comment.
json tags instead of yaml.
|
struct tags fixed |
|
Test error seems like a new error from the vagrant plugin: |
@smarterclayton did you turn on parallel? the RHEL images don't have a recent level of make |
|
lgtm |
5f07bb0 to
90e8d65
Compare
|
looks like an etcd flake: [merge] |
|
Needs rebase on top of Kube rebase |
90e8d65 to
4391347
Compare
|
Evaluated for origin test up to 4391347 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/513/) |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/4768/) (Image: devenv-rhel7_3269) |
|
[merge] |
|
Evaluated for origin merge up to 4391347 |
Merged by openshift-bot
Adds admission control plugin to control quota per plugin configuration.