Commit Graph

1639 Commits (8d7ba2bea2ffab83115a56dc9cc67dc8ab067a2c)

Author SHA1 Message Date
Kubernetes Submit Queue d368148deb Merge pull request #41297 from gyliu513/admit
Automatic merge from submit-queue

Improved test code coverage for plugin/pkg/admission/admit.

**What this PR does / why we need it**:'
part of #39559 , code coverage improved from 60% to 80%
2017-03-25 18:08:20 -07:00
Kubernetes Submit Queue 02ed99ac05 Merge pull request #40849 from k82cn/adm_exec
Automatic merge from submit-queue (batch tested with PRs 42672, 42770, 42818, 42820, 40849)

Improved the code coverage of plugin/pkg/admission/exec.

part of #39559 

refer to the attachment for code coverage: [combined-coverage.html.gz](https://github.com/kubernetes/kubernetes/files/746891/combined-coverage.html.gz)
2017-03-25 14:27:29 -07:00
Guangya Liu c99a2a2b0f Improved test code coverage for plugin/pkg/admission/admit. 2017-03-25 10:27:18 +08:00
Kubernetes Submit Queue 9169eda66a Merge pull request #41404 from k82cn/correct_comments
Automatic merge from submit-queue

Updated comments for admission/storageclass.

Correct comments to reflect fun's feature.
2017-03-24 10:26:33 -07:00
Jordan Liggitt dd7561801a
Authorize PSP usage for pods without service accounts 2017-03-21 19:54:39 -04:00
Jordan Liggitt 939ca532aa
generated files 2017-03-20 23:57:38 -04:00
Klaus Ma 9aad72f6c8 Improved the code coverage of plugin/pkg/admission/exec. 2017-03-19 09:35:19 +08:00
Jordan Liggitt 8fda1c716b
Remove 'all namespaces' meaning of empty list in PodAffinityTerm 2017-03-17 00:32:07 -04:00
Kubernetes Submit Queue 9e8114655f Merge pull request #40404 from tanshanshan/unit-test-scheduler4
Automatic merge from submit-queue (batch tested with PRs 40404, 43134, 43117)

Improve code coverage for scheduler/api/validation

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

Improve code coverage for scheduler/api/validation from #39559

Thanks
**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-03-15 08:27:20 -07:00
Kubernetes Submit Queue 42cdb052b6 Merge pull request #42968 from timothysc/sched_e2e_breakout
Automatic merge from submit-queue (batch tested with PRs 42775, 42991, 42968, 43029)

Initial breakout of scheduling e2es to help assist in assignment and refactoring

**What this PR does / why we need it**:
This PR segregates the scheduling specific e2es to isolate the library which will assist both in refactoring but also auto-assignment of issues.  

**Which issue this PR fixes** 
xref: https://github.com/kubernetes/kubernetes/issues/42691#issuecomment-285563265

**Special notes for your reviewer**:
All this change does is shuffle code around and quarantine.  Behavioral, and other cleanup changes, will be in follow on PRs.  As of today, the e2es are a monolith and there is massive symbol pollution, this 1st step allows us to segregate the e2es and tease apart the dependency mess. 

**Release note**:

```
NONE
```

/cc @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-testing-pr-reviews @marun @skriss 

/cc @gmarek - same trick for load + density, etc.
2017-03-14 13:52:43 -07:00
Kubernetes Submit Queue dc2b0ee2cf Merge pull request #43034 from enisoc/statefulset-patch
Automatic merge from submit-queue (batch tested with PRs 43034, 43066)

Allow StatefulSet controller to PATCH Pods.

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

StatefulSet now needs the PATCH permission on Pods since it calls into ControllerRefManager to adopt and release. This adds the permission and the missing e2e test that should have caught this.

**Which issue this PR fixes**:

**Special notes for your reviewer**:

This is based on #42925.

**Release note**:
```release-note
```
cc @kubernetes/sig-apps-pr-reviews
2017-03-14 11:44:37 -07:00
Anthony Yeh 53a6f4402f Allow StatefulSet controller to PATCH Pods.
Also add an e2e test that should have caught this.
2017-03-14 09:27:33 -07:00
Joe Beda c46d6bb825
Use constant time compare for bootstrap tokens
Signed-off-by: Joe Beda <joe.github@bedafamily.com>
2017-03-14 14:06:33 +00:00
Timothy St. Clair 6cc40678b6 Initial breakout of scheduling e2es to help assist in both assignment
and refactoring.
2017-03-13 22:34:57 -05:00
Janet Kuo b6e3993c96 Allow daemonset controller to patch pods for ControllerRef management 2017-03-13 11:37:17 -07:00
Kubernetes Submit Queue 8cb14a4f7f Merge pull request #42755 from aveshagarwal/master-fix-default-toleration-seconds
Automatic merge from submit-queue (batch tested with PRs 41794, 42349, 42755, 42901, 42933)

Fix DefaultTolerationSeconds admission plugin

DefaultTolerationSeconds is not working as expected. It is supposed to add default tolerations (for unreachable and notready conditions). but no pod was getting these toleration. And api server was throwing this error:

```
Mar 08 13:43:57 fedora25 hyperkube[32070]: E0308 13:43:57.769212   32070 admission.go:71] expected pod but got Pod
Mar 08 13:43:57 fedora25 hyperkube[32070]: E0308 13:43:57.789055   32070 admission.go:71] expected pod but got Pod
Mar 08 13:44:02 fedora25 hyperkube[32070]: E0308 13:44:02.006784   32070 admission.go:71] expected pod but got Pod
Mar 08 13:45:39 fedora25 hyperkube[32070]: E0308 13:45:39.754669   32070 admission.go:71] expected pod but got Pod
Mar 08 14:48:16 fedora25 hyperkube[32070]: E0308 14:48:16.673181   32070 admission.go:71] expected pod but got Pod
```

The reason for this error is that the input to admission plugins is internal api objects not versioned objects so expecting versioned object is incorrect. Due to this, no pod got desired tolerations and it always showed:

```
Tolerations: <none>
```

After this fix, the correct  tolerations are being assigned to pods as follows:

```
Tolerations:	node.alpha.kubernetes.io/notReady=:Exists:NoExecute for 300s
		node.alpha.kubernetes.io/unreachable=:Exists:NoExecute for 300s
```

@davidopp @kevin-wangzefeng @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-scheduling-bugs @derekwaynecarr 

Fixes https://github.com/kubernetes/kubernetes/issues/42716
2017-03-10 22:02:18 -08:00
Kubernetes Submit Queue 2be623b14f Merge pull request #38805 from xilabao/add-err-info-to-authorize-in-psp
Automatic merge from submit-queue

add err info to authorize in psp

It's unwise to ignore the err in my view.
2017-03-10 13:32:19 -08:00
tanshanshan 6fd76dc139 fix 2017-03-10 10:44:21 +08:00
Avesh Agarwal 9f533de80d Fix DefaultTolerationSeconds admission plugin. It was using
versioned object whereas admission plugins operate on internal objects.
2017-03-09 20:24:43 -05:00
Kubernetes Submit Queue 342ef1115c Merge pull request #42778 from k82cn/sched_cache_sync
Automatic merge from submit-queue (batch tested with PRs 42762, 42739, 42425, 42778)

Fixed potential OutOfSync of nodeInfo.

The cloned NodeInfo still share the same resource objects in cache; it may make `requestedResource` and Pods OutOfSync, for example, if the pod was deleted, the `requestedResource` is updated by Pods are not in cloned info. Found this when investigating #32531 , but seems not the root cause, as nodeInfo are readonly in predicts & priorities.

Sample codes for `&(*)`:

```
package main

import (
	"fmt"
)

type Resource struct {
	A int
}

type Node struct {
	Res *Resource
}

func main() {
	r1 := &Resource { A:10 }
	n1 := &Node{Res: r1}
	r2 := &(*n1.Res)
	r2.A = 11

	fmt.Printf("%t, %d %d\n", r1==r2, r1, r2)
}
```

Output:

```
true, &{11} &{11}
```
2017-03-09 02:51:42 -08:00
Klaus Ma 9b1e5ec507 Fixed potential OutOfSync of nodeInfo. 2017-03-09 11:09:38 +08:00
Kubernetes Submit Queue 7491fb865d Merge pull request #42708 from timchenxiaoyu/prioritytypo
Automatic merge from submit-queue (batch tested with PRs 42652, 42681, 42708, 42730)

fix priority typo
2017-03-08 11:38:09 -08:00
timchenxiaoyu 8780e29dea fix priority typo 2017-03-08 12:35:25 +08:00
Kubernetes Submit Queue 5bc7387b3c Merge pull request #42169 from ncdc/pprof-trace
Automatic merge from submit-queue (batch tested with PRs 42692, 42169, 42173)

Add pprof trace support

Add support for `/debug/pprof/trace`

Can wait for master to reopen for 1.7.

cc @smarterclayton @wojtek-t @gmarek @timothysc @jeremyeder @kubernetes/sig-scalability-pr-reviews
2017-03-07 20:10:26 -08:00
Andy Goldstein b011529d8a Add pprof trace support
Add pprof trace support and --enable-contention-profiling to those
components that don't already have it.
2017-03-07 10:10:42 -05:00
Connor Doyle 364dbc0ca5 Revert "Revert "Pods pending due to insufficient OIR should get scheduled once sufficient OIR becomes available.""
- This reverts commit 60758f3fff.
- Disabled opaque integer resource end-to-end tests.
2017-03-06 17:48:09 -08:00
Dawn Chen 60758f3fff Revert "Pods pending due to insufficient OIR should get scheduled once sufficient OIR becomes available." 2017-03-06 14:27:17 -08:00
Kubernetes Submit Queue 0fad9ce5e2 Merge pull request #41870 from intelsdi-x/test-out-of-oir
Automatic merge from submit-queue (batch tested with PRs 31783, 41988, 42535, 42572, 41870)

Pods pending due to insufficient OIR should get scheduled once sufficient OIR becomes available.

This appears to be a regression since v1.5.0 in scheduler behavior for opaque integer resources, reported in https://github.com/kubernetes/kubernetes/issues/41861.

- [X] Add failing e2e test to trigger the regression
- [x] Restore previous behavior (pods pending due to insufficient OIR get scheduled once sufficient OIR becomes available.)
2017-03-06 11:30:24 -08:00
deads2k d89862beca update names for kube plugin initializer to avoid conflicts 2017-03-06 10:18:21 -05:00
Kubernetes Submit Queue df70b30e59 Merge pull request #40537 from gnufied/fix-multizone-pv-breakage
Automatic merge from submit-queue

Fix Multizone pv creation on GCE

When Multizone is enabled static PV creation on GCE
fails because Cloud provider configuration is not
available in admission plugins.

cc @derekwaynecarr @childsb
2017-03-05 11:16:46 -08:00
Connor Doyle 8a42189690 Fix unbounded growth of cached OIRs in sched cache
- Added schedulercache.Resource.SetOpaque helper.
- Amend kubelet allocatable sync so that when OIRs are removed from capacity
  they are also removed from allocatable.
- Fixes #41861.
2017-03-04 09:26:22 -08:00
Kubernetes Submit Queue 346c0ba993 Merge pull request #42351 from liggitt/scheduler-statefulset
Automatic merge from submit-queue (batch tested with PRs 41919, 41149, 42350, 42351, 42285)

Add read permissions for statefulsets for kube-scheduler

https://github.com/kubernetes/kubernetes/issues/41708 added statefulset awareness to the scheduler. This adds the corresponding permission to the scheduler role.
2017-03-03 16:44:43 -08:00
Kubernetes Submit Queue e9bbfb81c1 Merge pull request #41306 from gnufied/implement-interface-bulk-volume-poll
Automatic merge from submit-queue (batch tested with PRs 41306, 42187, 41666, 42275, 42266)

Implement bulk polling of volumes

This implements Bulk volume polling using ideas presented by
justin in https://github.com/kubernetes/kubernetes/pull/39564

But it changes the implementation to use an interface
and doesn't affect other implementations.

cc @justinsb
2017-03-03 10:54:38 -08:00
Hemant Kumar 786da1de12 Impement bulk polling of volumes
This implements Bulk volume polling using ideas presented by
justin in https://github.com/kubernetes/kubernetes/pull/39564

But it changes the implementation to use an interface
and doesn't affect other implementations.
2017-03-02 14:59:59 -05:00
Kubernetes Submit Queue 6969aff027 Merge pull request #42128 from jsafrane/v1-2-combined
Automatic merge from submit-queue (batch tested with PRs 42128, 42064, 42253, 42309, 42322)

Add storage.k8s.io/v1 API

This is combined version of reverted #40088 (first 4 commits) and #41646. The difference is that all controllers and tests use old `storage.k8s.io/v1beta1` API so in theory all tests can pass on GKE.

Release note:
```release-note
StorageClassName attribute has been added to PersistentVolume and PersistentVolumeClaim objects and should be used instead of annotation `volume.beta.kubernetes.io/storage-class`. The beta annotation is still working in this release, however it will be removed in a future release.
```
2017-03-02 05:00:39 -08:00
Kubernetes Submit Queue 77d644f283 Merge pull request #42245 from deads2k/rbac-06-namespace-leak
Automatic merge from submit-queue (batch tested with PRs 42126, 42130, 42232, 42245, 41932)

allow subject access review to non-existent namespace

A localsubjectaccessreview is a special kind of resource which can be created even when the namespace doesn't exist.  Since permissions can be granted at different scopes, you can reasonably check if someone *could* do something at a lower scope that isn't there yet.  In addition, the permission to do an access check is separate from the permission to list all namespaces, so we're leaking information.

@liggitt @kubernetes/sig-auth-pr-reviews
2017-03-02 02:07:28 -08:00
Jan Safranek ca7cdc8c96 admission controller: use attributes instead beta annotations 2017-03-02 10:23:56 +01:00
Jan Safranek 7ae4152712 Move PV/PVC annotations to PV/PVC types.
They aren't part of storage.k8s.io/v1 or v1beta1 API.
Also move associated *GetClass functions.
2017-03-02 10:23:55 +01:00
Kubernetes Submit Queue 47f63acf23 Merge pull request #41931 from jessfraz/pip
Automatic merge from submit-queue (batch tested with PRs 41931, 39821, 41841, 42197, 42195)

Admission Controller: Add Pod Preset

Based off the proposal in https://github.com/kubernetes/community/pull/254

cc @pmorie @pwittrock 

TODO:
- [ ] tests



**What this PR does / why we need it**: Implements the Pod Injection Policy admission controller

**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
Added new Api `PodPreset` to enable defining cross-cutting injection of Volumes and Environment into Pods.
```
2017-03-01 20:07:54 -08:00
Kubernetes Submit Queue 01bfbb5fa0 Merge pull request #42259 from deads2k/rbac-07-reconcile-binding
Automatic merge from submit-queue

Add RBAC roles for bootstrap controllers

Supercedes https://github.com/kubernetes/kubernetes/pull/42221

When locking down controllers to individual RBAC roles we need to make sure that the bootstrap controllers have the right permissions.

This adds the roles and bindings at the correct namespace scopes for the bootstrap-signer and token-cleaner controllers.

@liggitt ptal
@jbeda @luxas you got a good way to test this?  It must not be covered in normal e2e or we'd've seen the issue before.
2017-03-01 16:57:51 -08:00
Jess Frazelle 9b5d1af3ca
run generators and updaters
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-03-01 13:04:29 -08:00
Jess Frazelle fe84363ce2
Add settings API and admission controller
export functions from pkg/api/validation

add settings API

add settings to pkg/registry

add settings api to pkg/master/master.go

add admission control plugin for pod preset

add new admission control plugin to kube-apiserver

add settings to import_known_versions.go

add settings to codegen

add validation tests

add settings to client generation

add protobufs generation for settings api

update linted packages

add settings to testapi

add settings install to clientset

add start of e2e

add pod preset plugin to config-test.sh

Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-03-01 13:04:28 -08:00
Jordan Liggitt 4525e042fc
Add read permissions for statefulsets for kube-scheduler 2017-03-01 15:08:48 -05:00
Maciej Szulik 6173c4bbab Generated changes for apps/v1beta1.deployments 2017-03-01 15:14:41 +01:00
Maciej Szulik c272630b1b Deployments under apps/v1beta1 with new defaults 2017-03-01 15:14:41 +01:00
Klaus Ma ef7610a038 Updated comments for admission/storageclass. 2017-03-01 19:32:08 +08:00
Kubernetes Submit Queue 79b5ccc176 Merge pull request #41708 from bsalamat/statefulset_spreading2
Automatic merge from submit-queue (batch tested with PRs 42200, 39535, 41708, 41487, 41335)

Add support for statefulset spreading to the scheduler

**What this PR does / why we need it**:
The scheduler SelectorSpread priority funtion didn't have the code to spread pods of StatefulSets. This PR adds StatefulSets to the list of controllers that SelectorSpread supports.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Add the support to the scheduler for spreading pods of StatefulSets.
```
2017-02-28 20:16:08 -08:00
deads2k 1cb582a03a add roles and bindings for bootstrap controllers 2017-02-28 13:14:58 -05:00
deads2k e24b1c0c25 add namespaced role bindings 2017-02-28 13:04:23 -05:00
Hemant Kumar b0581d688d Fix Multizone pv creation on GCE
When Multizone is enabled static PV creation on GCE
fails because Cloud provider configuration is not
available in admission plugins.
2017-02-28 12:24:14 -05:00