Commit Graph

2137 Commits (5e178936a1d989573b038ab0bd4b68521f8c5661)

Author SHA1 Message Date
Avesh Agarwal 13289d2218 Allow override of cluster level (default, whitelist) tolerations by namespace level empty (default, whitelist) tolerations. 2017-11-01 10:47:52 -04:00
Karol Wychowaniec 69d81c926a Allow HPA to get custom metrics 2017-10-31 11:46:07 +01:00
Stewart-YU bc2845ee08 Add explain for preempt sunction. 2017-10-31 08:27:52 +08:00
Kubernetes Submit Queue 7a944a69d6
Merge pull request #54485 from sttts/sttts-unify-admission-constructors
Automatic merge from submit-queue (batch tested with PRs 54761, 54748, 53991, 54485, 46951). 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>.

admission: unify plugin constructors

It's common in Go to return the actual object in constructors, not **one interface**
it implements. This allows us to implement multiple interfaces, but only have
one constructor. As having private types in constructors, we export all plugin structs, of course with private fields.

Note: super interfaces do not work if there are overlapping methods.
2017-10-30 15:38:33 -07:00
Dr. Stefan Schimanski ce6ecbbc54 Remove all api.Scheme references by using explicit package aliases 2017-10-30 19:54:02 +01:00
Kubernetes Submit Queue 9c35982e1a
Merge pull request #54691 from wackxu/priadm
Automatic merge from submit-queue. 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>.

update wrong group for priorityclasses

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

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

**Special notes for your reviewer**:

assgin @bsalamat 

**Release note**:

```release-note
NONE
```
2017-10-30 10:31:03 -07:00
Dr. Stefan Schimanski 131905cdb8 admission: unify plugin constructors 2017-10-30 16:56:38 +01:00
Kubernetes Submit Queue 7c96feb298
Merge pull request #54047 from kuramal/my
Automatic merge from submit-queue. 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>.

Optimize Repeated registration of AlgorithmProvider when ApplyFeatureGates

**What this PR does / why we need it**:
modified ApplyFeatureGates() just add/del features, cancel the register of all AlgorithmProvider.

 there is Repeated registration of all AlgorithmProvider when ApplyFeatureGates() runs;
AlgorithmProvider have already registered when  package defaults loaded;
I think ApplyFeatureGates() is just add/del features, it needn't  register all AlgorithmProvider again
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```/release-note-none
```
2017-10-29 20:42:48 -07:00
wackxu 2430c24c61 update wrong group for priorityclasses 2017-10-28 10:35:41 +08:00
Kubernetes Submit Queue 27ef37a32d
Merge pull request #54320 from derekwaynecarr/quota-update
Automatic merge from submit-queue (batch tested with PRs 54331, 54655, 54320, 54639, 54288). 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>.

Ability to do object count quota for all namespaced resources

**What this PR does / why we need it**:
- Defines syntax for generic object count quota `count/<resource>.<group>`
- Migrates existing objects to support new syntax with old syntax
- Adds support to quota all standard namespace resources 
- Updates the controller to do discovery and replenishment on those resources
- Updates unit tests
- Tweaks admission configuration around quota
- Add e2e test for replicasets (demonstrate dynamic generic counting)

```
$  kubectl create quota test --hard=count/deployments.extensions=2,count/replicasets.extensions=4,count/pods=3,count/secrets=4
resourcequota "test" created
$ kubectl run nginx --image=nginx --replicas=2
$ kubectl describe quota
Name:                         test
Namespace:                    default
Resource                      Used  Hard
--------                      ----  ----
count/deployments.extensions  1     2
count/pods                    2     3
count/replicasets.extensions  1     4
count/secrets                 1     4
```

**Special notes for your reviewer**:
- simple object count quotas no longer require writing code
- deferring support for custom resources pending investigation about how to share caches with garbage collector.  in addition, i would like to see how this integrates with downstream quota usage in openshift.

**Release note**:
```release-note
Object count quotas supported on all standard resources using `count/<resource>.<group>` syntax
```
2017-10-27 15:42:24 -07:00
Kubernetes Submit Queue 7d628db7cb
Merge pull request #54657 from anfernee/sched
Automatic merge from submit-queue (batch tested with PRs 54635, 54250, 54657, 54696, 54700). 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 unused pods in genericScheduler

**What this PR does / why we need it**: source code cleanup. less confusion.

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-27 14:38:26 -07:00
Derek Carr 5b4ca14307 Update admission control framework for quota 2017-10-27 11:08:14 -04:00
Kubernetes Submit Queue 3a5eab236f Merge pull request #54538 from WIZARD-CXY/updatehostPort
Automatic merge from submit-queue. 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>.

delete the hostport from usedmap

**What this PR does / why we need it**:
delete the hostport record when pod is not on the host

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

Facilitate the further pr https://github.com/kubernetes/kubernetes/pull/52421. Because the code which detects the conflict between wantports and existingports is not quite clean now.
Besides remove the unused port from map will save the memory.

**Special notes for your reviewer**:

I and the original coder @k82cn agreed to make this change

**Release note**:

```release-note
NONE
```
2017-10-27 02:18:41 -07:00
Yongkun Anfernee Gui 6ef9cf4936 Remove unused pods in genericScheduler 2017-10-26 15:23:26 -07:00
David Eads 8c1fe1f61a move webhook admission to generic apiserver 2017-10-26 07:45:49 -04:00
Kubernetes Submit Queue 32847aab1d Merge pull request #51783 from jiulongzaitian/myfeature3
Automatic merge from submit-queue (batch tested with PRs 54081, 54271, 51783, 54600, 54594). 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>.

move getMaxVols function to predicates.go and add some NewVolumeCount…

…Predicate funcs

Signed-off-by: zhangjie <zhangjie0619@yeah.net>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
move getMaxVols function to predicates.go and add some NewVolumeCountPredicate funcs
```
2017-10-26 02:43:48 -07:00
zhangjie 968df828a0 move getMaxVols function to predicates.go and change the params of NewMaxPDVolumeCountPredicate funcs
Signed-off-by: zhangjie <zhangjie0619@yeah.net>
2017-10-26 12:11:09 +08:00
kuramal a48cc26443 Optimize Repeated registration of AlgorithmProvider when ApplyFeatureGates
Add InsertPredicateKeyToAlgorithmProviderMap() and RemovePredicateKeyFromAlgorithmProviderMap() to insert/remove fit predicate key of all algorithmProviders which in algorithmProviderMap
Add Func RemovePredicateKeyFromAlgoProvider() AND InsertPredicateKeyToAlgoProvider() which can insert/remove fit predicate key to specific algorithmProvider
2017-10-26 10:10:48 +08:00
Kubernetes Submit Queue 17638ee018 Merge pull request #54414 from deads2k/admission-08-options
Automatic merge from submit-queue (batch tested with PRs 53760, 48996, 51267, 54414). 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>.

update admission webhook to handle multiple auth domains

Fixes https://github.com/kubernetes/kubernetes/issues/54404

Adds some wiring to have the admission plugin accept a config file for per-apiserver configuration.

@kubernetes/sig-auth-api-reviews @deads2k @ericchiang @liggitt in particular
@kubernetes/sig-api-machinery-pr-reviews @lavalamp @caesarxuchao @sttts @cheftako

```release-note
generic webhook admission now takes a config file which describes how to authenticate to webhook servers
```
2017-10-25 17:37:11 -07:00
chenxingyu 195de933f1 delete the hostport from usedmap 2017-10-25 15:49:18 +08:00
Bobby (Babak) Salamat ccc62412a3 Autogenerated files 2017-10-24 16:04:58 -07:00
Bobby (Babak) Salamat 5497e893ae Change type of scheduling queue from cache.FIFO to a new interface 2017-10-24 16:04:58 -07:00
Haoran Wang 4b185b4db9 update scheduler to use schedulerName selector 2017-10-24 13:31:38 +08:00
Kubernetes Submit Queue 6a444673b9 Merge pull request #53914 from bsalamat/pdb
Automatic merge from submit-queue (batch tested with PRs 53903, 53914, 54374). 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>.

Add PodDisruptionBudget to scheduler cache.

**What this PR does / why we need it**:
This is the first step to add support for PodDisruptionBudget during preemption. This PR adds PDB to scheduler cache.

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

**Special notes for your reviewer**: None

**Release note**:

```release-note
Add PodDisruptionBudget to scheduler cache.
```

ref/ #53913
2017-10-23 12:27:06 -07:00
Kubernetes Submit Queue fd3878a59d Merge pull request #54333 from liggitt/webhook-service-resolver
Automatic merge from submit-queue (batch tested with PRs 54363, 54333). 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>.

Ensure port on resolved service host

The resolved host should include a port so it can be used by dialers directly. It's also not necessary to reparse the URL when constructing directly.

```release-note
NONE
```
2017-10-23 11:30:25 -07:00
David Eads fd4ab3e061 update admission webhook to handle multiple auth domains 2017-10-23 12:33:54 -04:00
Kubernetes Submit Queue 3812230f4d Merge pull request #48963 from Raffo/master
Automatic merge from submit-queue (batch tested with PRs 52792, 48963). 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>.

Fix range for min value in imagepolicy admission 

**What this PR does / why we need it**:
This makes the range for imagepolicy admission work properly. Currently if we specify `1s` for the value of `AllowTTL` or `DenyTTL` in the configuration yaml, we get a message like the following: 

```
Error: failed to initialize plugins: Couldn't init admission plugin "ImagePolicyWebhook": valid value is between 1s and 30m0s, got 1s
```

This is due to a wrong comparison which is fixed in this PR. The rest of the PR just adds tests for this behaviour.
2017-10-21 15:10:12 -07:00
Bobby (Babak) Salamat efc151f46b Autogenerated files 2017-10-20 23:22:03 -07:00
Bobby (Babak) Salamat 9a5d058e5e Add PodDisruptionBudget to scheduler cache. 2017-10-20 23:22:02 -07:00
Jordan Liggitt d45f01e953
Ensure port on resolved service host 2017-10-20 23:01:11 -04:00
Bobby (Babak) Salamat ffa9ed60a8 Fix scheduler permission to patch pods 2017-10-20 18:04:37 -07:00
Kubernetes Submit Queue 10cafb8390 Merge pull request #54309 from liggitt/replicaset-permissions
Automatic merge from submit-queue (batch tested with PRs 52147, 54309). 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>.

Update bootstrap policy with replicaset/daemonset permissions in the apps API group

Resolves #54310

Bootstrap policy was not updated when replicasets and daemonsets got promoted to the apps group

```release-note
Resolves forbidden error when accessing replicasets and daemonsets via the apps API group
```
2017-10-20 14:58:14 -07:00
Jordan Liggitt 3789051726
Update bootstrap policy with replicaset/daemonset permissions in the apps API group 2017-10-20 12:59:39 -04:00
Kubernetes Submit Queue fe6258fb9b Merge pull request #54261 from yguo0905/sched-fix
Automatic merge from submit-queue (batch tested with PRs 54031, 54261). 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>.

Allow absent Weight if PrioritizeVerb is empty

The scheduler currently validates `ExtenderConfig.Weight` (the weight applied to `Prioritize`) even when `ExtenderConfig.PrioritizeVerb` is empty, which is not correct. A configuration without these two fields should be allowed. 

**Release note**:
```
None
```

/sig scheduling
2017-10-20 02:26:58 -07:00
Kubernetes Submit Queue 2523e3ebae Merge pull request #53759 from anfernee/sched-test
Automatic merge from submit-queue. 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>.

Make scheduler integration test faster

Not to wait for 30 seconds for every negative test case. This commit
also organizes the test code to make it more readable.

It cuts the test time from 450s to 125s.

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

**Special notes for your reviewer**:

**Release note**: 
```release-note
NONE
```
2017-10-19 16:50:58 -07:00
Yang Guo 1c60898bf5 Allow absent Weight if PrioritizeVerb is empty 2017-10-19 15:10:44 -07:00
David Eads 4e79357f9f default admission hook failure safely 2017-10-19 14:30:39 -04:00
David Eads 0859798e8e update admission webhook to accept client config 2017-10-19 09:52:58 -04:00
David Eads 33deaedaf6 add url path for admission webhooks 2017-10-19 08:06:38 -04:00
Kubernetes Submit Queue 66222c3dbe Merge pull request #53982 from tizhou86/schedulerUnitTest7
Automatic merge from submit-queue (batch tested with PRs 52753, 54034, 53982, 54209). 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>.

Make test case description more accurate.

**What this PR does / why we need it**:
Make test case description more accurate. This test case tests the GCE persistent disk instead of the general one, change the name to make it consistent with AWS/Azure/ISCSI test cases.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2017-10-19 02:45:22 -07:00
Kubernetes Submit Queue 65d9b4ef0b Merge pull request #51450 from lichuqiang/typo_fix
Automatic merge from submit-queue. 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>.

fix bug in admission test

tiny bug fix
2017-10-18 21:40:51 -07:00
Kubernetes Submit Queue 3f2ce7e557 Merge pull request #51458 from CaoShuFeng/use_map_in_admit
Automatic merge from submit-queue (batch tested with PRs 51310, 51458, 47636). 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 useless allocation of map

This one-element map is only used for checking api. Remove it and
simplify the code.

**Release note**:
```
NONE
```
2017-10-18 20:47:07 -07:00
Kubernetes Submit Queue fa21e531f9 Merge pull request #49305 from zhangxiaoyu-zidif/fix-err-output-for-admission-test
Automatic merge from submit-queue (batch tested with PRs 49305, 54158). 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>.

fix error print for admission test

**What this PR does / why we need it**:
fix error print to make them easy to inspect.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
NONE
**Special notes for your reviewer**:
NONE
**Release note**:

```release-note
NONE
```
2017-10-18 16:35:17 -07:00
Kubernetes Submit Queue b3a9b802da Merge pull request #53823 from deads2k/admission-01-allow-fail
Automatic merge from submit-queue. 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>.

allow fail close webhook admission

Webhook admission needs to allow failing closed.  Even in an alpha state, I don't want to be one DDOS away from having an exposed cluster.

/assign caesarxuchao
/assign sttts
2017-10-18 14:49:54 -07:00
Kubernetes Submit Queue 900c0761e3 Merge pull request #53722 from deads2k/rbac-01-allow-star
Automatic merge from submit-queue. 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>.

allow */subresource in rbac policy rules

xref #29698
xref #38756
xref #49504
xref #38810

Allow `*/subresource` format in RBAC policy rules to support polymorphic subresources like `*/scale` for HPA.

@DirectXMan12 fyi

```release-note
RBAC PolicyRules now allow resource=`*/<subresource>` to cover `any-resource/<subresource>`.   For example, `*/scale` covers `replicationcontroller/scale`.
```
2017-10-18 14:02:05 -07:00
Kubernetes Submit Queue 1bea47aaca Merge pull request #53896 from deads2k/admission-03-decode
Automatic merge from submit-queue (batch tested with PRs 47717, 53896). 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>.

decode admission responses into a fresh object

Something about the way the admission request object is built causes decoding into back into it to fail with 

```
W1013 14:10:42.457423    2960 admission.go:185] rejected by webhook namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations &{%!t(string=namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations) %!t(*errors.errorString=&{reflect.Value.Addr of unaddressable value})}: failed calling admission webhook "namespacereservations.admission.online.openshift.io/apis/admission.online.openshift.io/v1alpha1/namespacereservations": reflect.Value.Addr of unaddressable value
```

This simply creates a fresh object to decode into, which works fine for our usage and makes it possible to actually have the webhook call out to something.
2017-10-18 11:52:06 -07:00
David Eads f81b6004de allow fail close webhook admission 2017-10-18 14:28:02 -04:00
Kubernetes Submit Queue 2d914ee703 Merge pull request #53984 from sttts/sttts-legacyscheme
Automatic merge from submit-queue. 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>.

pkg/api: extract Scheme/Registry/Codecs into pkg/api/legacyscheme

This serves as

- a preparation for the pkg/api->pkg/apis/core move
- and makes the dependency to the scheme explicit when vizualizing
  left depenncies.

The later helps with our our efforts to split up the monolithic repo
into self-contained sub-repos, e.g. for kubectl, controller-manager
and kube-apiserver in the future.
2017-10-18 10:49:10 -07:00
Kubernetes Submit Queue f1b17e8896 Merge pull request #53995 from deads2k/admission-04-owner
Automatic merge from submit-queue. 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>.

add deads to admission owners

/assign derekwaynecarr
2017-10-18 08:27:23 -07:00
Dr. Stefan Schimanski cad0364e73 Update bazel 2017-10-18 17:24:04 +02:00
Dr. Stefan Schimanski 7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
Kubernetes Submit Queue d462bac780 Merge pull request #54043 from x1957/fix_comment
Automatic merge from submit-queue. 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>.

fix the bad code comment 

**What this PR does / why we need it**:
fix the bad code comment in scheduler

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2017-10-17 23:50:06 -07:00
Kubernetes Submit Queue 229cbf4b6d Merge pull request #54030 from dims/fix-go1.9-admission-webhook-test-failure
Automatic merge from submit-queue (batch tested with PRs 54030, 54041). 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>.

Fix admission webhook test failure in go1.9

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

Go 1.9 has some better checks for SAN extensions, notably:
630e93ed2d

We recently added ServerName to the rest client TLSConfig:
186a0684d5 (diff-eb3573c6b11347dc3793c477726480efR262)

So we need to be sure that the ServerName "webhook-test.default.svc" is
present in the certificates that we generate."

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

Fixes #54020

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-10-17 21:26:00 -07:00
Yuhao Fang 3ef6a09cc0 fix the bad code comment in scheduler package 2017-10-18 09:59:24 +08:00
Kubernetes Submit Queue 4105ccac78 Merge pull request #53989 from shyamjvs/use-counter-in-scheduler
Automatic merge from submit-queue. 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 repeated random string generations in scheduler volume predicate

Ref https://github.com/kubernetes/kubernetes/issues/53327

@wojtek-t @liggitt @jsafrane - Does this look ok to you?
2017-10-17 18:43:36 -07:00
Shyam Jeedigunta 5a85f9d21c Remove repeated random string generations in scheduler volume predicate 2017-10-17 19:57:46 +02:00
Yongkun Anfernee Gui dc15e9cf90 Make scheduler integration test faster
Not to wait for 30 seconds for every negative test case. It cuts the
test time from 450s to 125s.
2017-10-17 10:32:46 -07:00
Kubernetes Submit Queue 0e21ac81c0 Merge pull request #51416 from justinsb/fix_nodeidentitifer_godocs
Automatic merge from submit-queue (batch tested with PRs 51416, 53535). 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>.

Fix NodeIdentifier godocs: IdentifyNode -> NodeIdentity
2017-10-17 08:44:13 -07:00
Kubernetes Submit Queue 76a4674bd4 Merge pull request #53739 from php-coder/remove_unused_functions_from_admission_test
Automatic merge from submit-queue (batch tested with PRs 54036, 53739). 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>.

admission_test.go: remove unused functions

**What this PR does / why we need it**:
PR removed unused `createNamespaceForTest()` and `createSAForTest()` functions from `admission_test.go`.

**Release note**:
```release-note
NONE
```

PTAL @liggitt @pweil- 
CC @simo5
2017-10-17 06:49:16 -07:00
Kubernetes Submit Queue 5152f342eb Merge pull request #54008 from yguo0905/sched-fix
Automatic merge from submit-queue (batch tested with PRs 53978, 54008, 53037). 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>.

Change scheduler to skip pod with updates only on pod annotations

Fixes #52914, by checking whether the pod is already assumed before scheduling it.

**Release note**:

```
Scheduler cache ignores updates to an assumed pod if updates are limited to pod annotations.
```

/sig scheduling
/assign @bsalamat 
/cc @vishh
2017-10-17 04:53:40 -07:00
Slava Semushin 1a3a2d47c8 admission_test.go: remove unused createNamespaceForTest() and createSAForTest() functions. 2017-10-17 12:03:46 +02:00
Davanum Srinivas 98509a9d05 Fix admission webhook test failure in go1.9
Go 1.9 has some better checks for SAN extensions, notably:
630e93ed2d

We recently added ServerName to the rest client TLSConfig:
186a0684d5 (diff-eb3573c6b11347dc3793c477726480efR262)

So we need to be sure that the ServerName "webhook-test.default.svc" is
present in the certificates that we generate."
2017-10-16 21:10:54 -04:00
Kubernetes Submit Queue 97808e5a86 Merge pull request #52849 from liggitt/psp-defaulting-order
Automatic merge from submit-queue (batch tested with PRs 48665, 52849, 54006, 53755). 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>.

Order PSP by name, prefer non-mutating PSPs

Fixes #36184
Fixes #23217
Related to #23217

Removes unnecessary mutation of pods:
* Determines effective security context for pods using a wrapper containing the pod and container security context, rather than building/setting a combined struct on every admission
* Does not set `privileged:&false` on security contexts with `privileged:nil`
* Does not set `runAsNonRoot:&true` on security contexts that already have a non-nil, non-0 `runAsUser`
* Does not mutate/normalize container capabilities unless changes are required (missing  defaultAddCapabilities or requiredDropCapabilities)

Defines behavior when multiple PSP objects allow a pod:
* PSPs which allow the pod as-is (no defaulting/mutating) are preferred
* If the pod must be defaulted/mutated to be allowed, the first PSP (ordered by name) to allow the pod is selected
* During update operations, when mutations to pod specs are disallowed, only non-mutating PSPs are used to validate the pod

```release-note
PodSecurityPolicy: when multiple policies allow a submitted pod, priority is given to ones which do not require any fields in the pod spec to be defaulted. If the pod must be defaulted, the first policy (ordered by name) that allows the pod is used.
```
2017-10-16 18:09:41 -07:00
Yang Guo 8b6bf4e235 Change scheduler to skip pod with only annotations updates 2017-10-16 13:30:25 -07:00
David Eads e8a703b651 allow */subresource in rbac policy rules 2017-10-16 16:17:51 -04:00
David Eads 926a615775 add deads to admission owners 2017-10-16 13:43:54 -04:00
Ti Zhou 3647a891d8 Make test case description more accurate. 2017-10-16 20:05:27 +08:00
Kubernetes Submit Queue 1ab5075c7c Merge pull request #52637 from stewart-yu/issue#06
Automatic merge from submit-queue. 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>.

Modify Schedule function

**What this PR does / why we need it**:
It is obvious that no need to prioritizing when only one node after predicate.

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

**Special notes for your reviewer**:
@davidopp @timothysc

**Release note**:

```release-note
NONE
```
2017-10-16 00:38:15 -07:00
Jordan Liggitt 8c5b01376a
PodSecurityPolicy: Order by name, prefer non-mutating policies, require *api.Pod, allow GC updates 2017-10-16 02:22:11 -04:00
Jordan Liggitt abc7c077e1
PodSecurityPolicy: avoid unnecessary mutation of supplemental groups 2017-10-16 02:21:10 -04:00
Jordan Liggitt b45b809f4c
PodSecurityPolicy: Do not mutate nil privileged field to false 2017-10-16 02:21:10 -04:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
stewart-yu 5937184db7 When only one node after predicate, just return it 2017-10-14 15:47:47 +08:00
Kubernetes Submit Queue 46ae7c4a30 Merge pull request #52903 from wackxu/mpi
Automatic merge from submit-queue (batch tested with PRs 53507, 53772, 52903, 53543). 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>.

Make configFactory private

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

Fix TODO make this private if possible, so that only its interface is externally used.
I have check the use of configFactory and it is safe to make it private.

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


**Release note**:

```release-note
NONE
```
2017-10-13 13:53:18 -07:00
David Eads 9adcbd72fb decode admission responses into a fresh object 2017-10-13 10:48:58 -04:00
Kubernetes Submit Queue d6b18a96dd Merge pull request #53611 from p0lyn0mial/pass_scheme_to_admission_plugins
Automatic merge from submit-queue. 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>.

removes k8s.io/kubernetes/pkg/api dependency from the webhook plugin.

**What this PR does / why we need it**: removes `k8s.io/kubernetes/pkg/api` dependency from `webhook` plugin. The runtime.scheme can be injected to the webhook from the plugin initializer.

**Release note**:

```
NONE
```
2017-10-10 13:53:27 -07:00
Kubernetes Submit Queue 6154a9e16c Merge pull request #53477 from caesarxuchao/genenic-initializer
Automatic merge from submit-queue. 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>.

Move initializer plugin to the generic apiserver

* Moves `k8s.io/kuberentes/plugin/pkg/admission/initialization` to `k8s.io/apiserver/pkg/admission/plugin/initialization`
* Moves `k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration` to `k8s.io/apiserver/pkg/admission/configuration`
* The initializer plugin used to depend on `k8s.io/kubernetes` because it does a type assertion of `api.Pod`. It tries to skip mirror pod. I converted that code to use the generic accessor pattern.
2017-10-10 09:46:00 -07:00
p0lyn0mial fa96700b76 removes k8s.io/kubernetes/pkg/api dependency from the webhook plugin. 2017-10-09 22:25:03 +02:00
Chao Xu bbac32c299 generated 2017-10-09 10:58:12 -07:00
Chao Xu 89a0511fcb move initializer to the generic apiserver
move k8s.io/kubernetes/plugin/pkg/admission/initialization to
k8s.io/apiserver/pkg/admission/plugin/initialization/initialization.go;
move k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration to
k8s.io/apiserver/pkg/admission/configuration.
2017-10-09 10:57:00 -07:00
Gavin 7f3c4ac1f4 clarify pridicates message when no nodes available
fix space

address comment
2017-10-07 08:17:04 +08:00
Kubernetes Submit Queue fe5c628e40 Merge pull request #53480 from k82cn/k8s_53425
Automatic merge from submit-queue. 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>.

Refresh scheduler equivalence cache when node taints changed.

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

**Release note**:
```release-note
None
```
2017-10-05 22:54:56 -07:00
Kubernetes Submit Queue c1703a4998 Merge pull request #53343 from p0lyn0mial/move_newAdmissionReview_method_to_webhook
Automatic merge from submit-queue. 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>.

moves admission.v1alpha1.NewAdmissionReview method to webhook plugin

**What this PR does / why we need it**:
this is necessary, because the webhook plugin will be moved down to apiserver.

**Release note**:

```
NONE
```
2017-10-05 02:24:14 -07:00
Klaus Ma 066c5e9657 Fixed alpha e2e test failure. 2017-10-05 15:33:31 +08:00
p0lyn0mial 187171284a moves admission.v1alpha1.NewAdmissionReview to webhook plugin
this is necessary, because the webhook plugin will be moved down to apiserver.
2017-10-04 19:50:27 +02:00
Kubernetes Submit Queue 8e30314c95 Merge pull request #53394 from p0lyn0mial/cleanup_kubeapi_admission_initializer
Automatic merge from submit-queue. 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>.

removes Authorizer and ExternalClientSet from kubeapiserver's admissi…

**What this PR does / why we need it**:
removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer.


**Release note**:

```
NONE
```
2017-10-04 07:50:35 -07:00
Kubernetes Submit Queue 731f42172b Merge pull request #51266 from resouer/not-ready
Automatic merge from submit-queue. 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 node taint conditions

**What this PR does / why we need it**:
We should use `not-ready` etc as node condition taint key.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Use `not-ready` to replace `notReady` in node condition taint keys.
```
2017-10-04 06:56:44 -07:00
Kubernetes Submit Queue bfb7f3c2a7 Merge pull request #53135 from jsafrane/fix-predicate-counting
Automatic merge from submit-queue (batch tested with PRs 53135, 52512, 48339). 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>.

Fixed counting of unbound PVCs towards limit of attached volumes.

Count unbound PVCs to the limit of attached volumes to a node. 

When MaxPDVolumeCountPredicate is in doubt (e.g. PVC or PV is missing), it assumes the volume is attached. It should assume the same when it encounters an unbound PVC. In any case, it should not return an error, it would stop scheduling all pods with a PVC.

Fixes: #53134

```release-note
NONE
```
2017-10-03 13:08:13 -07:00
p0lyn0mial 6b1f1d1414 removes Authorizer and ExternalClientSet from kubeapiserver's admission initializer. 2017-10-03 18:08:30 +02:00
Kubernetes Submit Queue 0c6970bf7b Merge pull request #52723 from k82cn/k8s_42001_5
Automatic merge from submit-queue (batch tested with PRs 52723, 53271). 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>.

Apply algorithm in scheduler by feature gates.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: part of #42001

**Release note**:
```release-note
Apply algorithm in scheduler by feature gates.
```
2017-10-03 05:15:20 -07:00
Kubernetes Submit Queue 8eb37aee3a Merge pull request #53359 from liggitt/swagger.json
Automatic merge from submit-queue (batch tested with PRs 50749, 52869, 53359). 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>.

Add /swagger.json and /swagger-2.0.0.pb-v1 to discovery role

Allow access to openapi docs
Fixes #53349
2017-10-02 21:43:14 -07:00
Jordan Liggitt d657261f9b
Add /swagger.json and /swagger-2.0.0.pb-v1 to discovery role 2017-10-02 21:52:13 -04:00
Kubernetes Submit Queue dd99659dc1 Merge pull request #53156 from p0lyn0mial/move_admission_initializer_interfaces_to_apiserver
Automatic merge from submit-queue. 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>.

moved admission interfaces WantsClientCert, WantsAuthorizer and Wants…

**What this PR does / why we need it**:
moves some admission interfaces to apiserver, hopefully moving the webhook admission in the future will be much easier.

**Release note**:

```
NONE
```
2017-10-02 12:06:26 -07:00
Jan Safranek 2caae38d32 Fixed counting of unbound PVCs towards limit of attached volumes.
There are two ways how a scheduled pod can get its PVCs unbound:
- admin forcefuly unbinds it
- user deletes original PVC that was bound when the pod was scheduled and
  creates a new one with the same name that does not get bound from some
  reason.

In both cases we don't know where the original PVC pointed at and if we
should account it to the limit of attached AWS EBS / GCE PDs etc.

The common pattern here is to count it in when in doubt.
2017-10-02 15:49:34 +02:00
Kubernetes Submit Queue 2ec89d1e13 Merge pull request #53247 from surajssd/remove-unused-predicate-args-func
Automatic merge from submit-queue (batch tested with PRs 53247, 53319). 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 unused function addStorageLimit

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

In package `plugin/pkg/scheduler/algorithm/predicates` remove unused
unexported function `addStorageLimit`.


**Release note**:

```release-note
NONE
```
2017-10-02 04:51:26 -07:00
p0lyn0mial 475493ced6 moved admission interfaces WantsClientCert, WantsAuthorizer and WantsExternalKubeClientSet to apiserver 2017-10-01 15:03:08 +02:00
Klaus Ma bd15efd3e5 Enhance scheduler for TaintNodeByCondition. 2017-10-01 08:26:35 +08:00
Kubernetes Submit Queue 887598c2eb Merge pull request #52654 from liggitt/pdb-permissions
Automatic merge from submit-queue (batch tested with PRs 53263, 52967, 53262, 52654, 53187). 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>.

Add pod disruption budgets to admin/edit/view roles

Closes #50767

cc @kubernetes/sig-auth-pr-reviews @kubernetes/sig-node-pr-reviews

```release-note
RBAC: The default `admin` and `edit` roles now include read/write permissions and the `view` role includes read permissions on `poddisruptionbudget.policy` resources.
```
2017-09-29 13:37:30 -07:00
Suraj Deshmukh bf25a2753b remove unused function addStorageLimit
In package `plugin/pkg/scheduler/algorithm/predicates` remove unused
unexported function `addStorageLimit`.
2017-09-29 12:17:52 +05:30
wackxu 2db3728fb7 use patch PodStatus to avoid overwriting potential pending status updates 2017-09-25 22:00:10 +08:00