Commit Graph

47 Commits

Author SHA1 Message Date
Jordan Liggitt
bef996d0a4 Only reject quota admission if status is missing relevant usage 2019-03-26 23:15:40 -04:00
Walter Fender
f192657380 Add gauge metric for master of leader election.
Fixes #71730
0 indicates standby, 1 indicates master, label indicates which lease.
Tweaked name and documentation
Factored in Mike Danese feedback.
Removed dependency on prometheus from client-go using adapter.
Centralized adapter import.
Fixed godeps
Fixed boilerplate.
Put in fixes for caesarxuchao
2018-12-27 09:40:33 -08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
yue9944882
b86e8f7631 externalize quota admission controller 2018-08-27 21:47:10 +08:00
Kubernetes Submit Queue
524a81496b
Merge pull request #66866 from kgolab/kg-quota-refactor
Automatic merge from submit-queue (batch tested with PRs 67160, 67090, 67159, 66866, 62111). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor checkRequest to allow it to be called from outside

**What this PR does / why we need it**:

Refactor checkRequest method to allow it to be called from outside of admission controller (most of its body does not depend on any quotaEvaluator properties).

```release-note
NONE
```
2018-08-09 15:11:07 -07:00
jennybuckley
adafb1365e Support dry run in admission plugins 2018-08-06 10:37:44 -07:00
Karol Gołąb
786a0c6294 Refactor checkRequest to allow it to be called from outside of admission controller 2018-08-01 16:15:27 +02:00
yue9944882
ccb1ec7a36 fixes operation for "create on update"
remove create-on-update logic for quota controller

review: add more error check

remove unused args

revert changes in patch.go

use hasUID to judge if it's a create-on-update
2018-07-10 17:22:09 +08:00
Kubernetes Submit Queue
f7de67a191
Merge pull request #64598 from MikeSpreitzer/fix-63608-b
Automatic merge from submit-queue (batch tested with PRs 65152, 65199, 65179, 64598, 65216). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove optimization from getWork in resourcequota/controller.go

**What this PR does / why we need it**:
This change simplifies the code in
plugin/pkg/admission/resourcequota/controller.go by removing the
optimization in getWork that required the caller to NOT call
completeWork if getWork returns the empty list of work.  BTW, the
caller was not obeying that requirement; now the caller's behavior
(which is unchanged) is right.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63608 

**Special notes for your reviewer**:
This is a simpler alternative to #64377 

**Release note**:

```release-note
NONE
```
2018-06-21 18:20:15 -07:00
vikaschoudhary16
3cfe6412c7 Introduce priority class in the resource quota 2018-06-04 16:14:54 -04:00
Mike Spreitzer
640d5b7363 Remove optimization from getWork in resourcequota/controller.go
This change simplifies the code in
plugin/pkg/admission/resourcequota/controller.go by removing the
optimization in getWork that required the caller to NOT call
completeWork if getWork returns the empty list of work.  BTW, the
caller was not obeying that requirement; now the caller's behavior
(which is unchanged) is right.

Fixes #63608
2018-05-31 22:43:54 -07:00
xuzhonghu
5caf141650 resourcequota return StatusError when timeout 2018-05-24 16:35:19 +08:00
Cao Shufeng
1ba7082176 not return 500 status code for insufficient quota 2018-04-09 17:49:09 +08:00
David Eads
7dc7693e86 make quota reusable 2017-12-13 08:39:55 -05:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Derek Carr
5b4ca14307 Update admission control framework for quota 2017-10-27 11:08:14 -04:00
Hemant Kumar
066fcf785e Implement support for updating resources 2017-09-13 21:05:44 -04:00
Dr. Stefan Schimanski
42b40ddc0f admission plugins: simplify deepcopy calls 2017-08-29 20:01:08 +02:00
Chao Xu
4928c8d1bf let resourcequota evaluator handle uninitialid pod and pvc 2017-08-24 14:50:03 -07:00
deads2k
151d39682e add reflector metrics 2017-07-25 09:01:37 -04:00
FengyunPan
a398e848be Update limitedByDefault() which does not return error 2017-04-06 16:24:54 +08:00
Derek Carr
3fad0cb52a Implement support for limited resources in quota 2017-02-18 12:10:22 -05:00
Guangya Liu
9607edc556 Clean up for some typo.
1) Removed a space in portforward.go.
2) Renamed `lockAquisitionFunc` to `lockAcquisitionFunc` in
controller.go.
3) Fixed typo in predicates.go.
2017-02-08 09:39:03 +08:00
deads2k
2c1c0f3f72 move workqueue to client-go 2017-01-30 09:08:21 -05:00
deads2k
01b3b2b461 move admission to genericapiserver 2017-01-18 08:15:19 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Derek Carr
459a7a05f1 Ability to quota storage by storage class 2016-12-09 13:26:59 -05:00
Kubernetes Submit Queue
669efd72a4 Merge pull request #34041 from pigmej/fix_typos_plugin
Automatic merge from submit-queue

Fix typos and englishify plugin/pkg

**What this PR does / why we need it**:  Just typos

**Which issue this PR fixes**: `None`

**Special notes for your reviewer**: Just typos

**Release note**: `NONE`
2016-10-15 02:13:06 -07:00
Jedrzej Nowak
d2161c21d7 Fix typos and englishify plugin/pkg 2016-10-04 17:51:14 +02:00
Chao Xu
feb0d1daa8 decouple workqueue metrics from prometheus 2016-10-03 11:02:06 -07:00
Kubernetes Submit Queue
dc8f384e3f Merge pull request #31627 from deads2k/quota-copy
Automatic merge from submit-queue

make deep copy of quota objects before mutations

The code currently makes shallow copies which ensures that we aren't accidentally reslicing anything in weird ways, but the usage maps are pointers, so they end up being shared.

This makes a couple copies when we know we're going to mutate to avoid changing shared maps.
2016-09-01 10:09:01 -07:00
deads2k
4317173d3f add names for workqueues to gather controller latency/depth metrics 2016-08-30 09:51:50 -04:00
deads2k
f4380f6919 make deep copy of quota objects before mutations 2016-08-29 13:55:13 -04:00
Kubernetes Submit Queue
4145824911 Merge pull request #30907 from deads2k/fix-quota-updates
Automatic merge from submit-queue

only compute delta on non-creating updates

If you're issuing an update that can cause a create, the quota admission charge should be based on the create cost, otherwise you always end up with zero.

@derekwaynecarr ptal, blocker bug.
2016-08-20 16:16:02 -07:00
deads2k
44808c64ae only compute delta on non-creating updates 2016-08-18 13:41:33 -04:00
derekwaynecarr
307832dbec Quota usage checking ignores unrelated resources 2016-08-17 16:25:25 -04:00
derekwaynecarr
5cca4b07c6 Quota admission errors if usage is negative 2016-08-11 11:26:59 -04:00
derekwaynecarr
a672a986e3 Admission control errors should have consistent lower casing 2016-08-08 10:31:23 -04:00
joe2far
5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
deads2k
ada37c2163 allow lock acquisition injection for quota admission 2016-07-06 09:39:42 -04:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
deads2k
a28cf3963b refactor quota evaluation to cleanly abstract the quota access 2016-06-28 11:38:18 -04:00
derekwaynecarr
ce44b3b98a Quota can look for a previous object from admission rather than do a lookup 2016-06-13 09:50:53 -04:00
deads2k
02c0181f26 reduce conflict retries 2016-05-23 13:09:37 -04:00
derekwaynecarr
fc3e71894d Improve quota integration test to not use events, reduce number of pods provisioned 2016-05-10 19:50:36 -04:00
deads2k
0061479890 fully qualify admission resources and kinds 2016-04-26 07:55:33 -04:00
deads2k
d3c6363093 use single writer to improve quota performance 2016-04-25 10:42:26 -04:00