Commit Graph

1389 Commits (954a86d701a53276881c86ee85275a406d0dea99)

Author SHA1 Message Date
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue a7807eb5a4 Merge pull request #34138 from ingvagabund/create-restclient-interface
Automatic merge from submit-queue

Create restclient interface

Refactoring of code to allow replace *restclient.RESTClient with any RESTClient implementation that implements restclient.RESTClientInterface interface.
2016-10-21 16:02:04 -07:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
Kubernetes Submit Queue b0a4216182 Merge pull request #33763 from jayunit100/sched-checkservice-predicateCache
Automatic merge from submit-queue

Predicate cacheing and cleanup

Fix to #31795 

First pass @ cleanup and caching of the CheckServiceAffinity function.  

The cleanup IMO is necessary because the logic around the pod listing and the use of the "implicit selector" (which is reverse engineered to enable the homogenous pod groups).

Should still pass the E2Es.

@timothysc @wojtek-t
2016-10-20 07:39:41 -07:00
jayunit100 08cff0157d PredicateMetadata factory and optimization, Cleaned up some comments,
Comments addressed, Make emptyMetadataProducer a func to avoid casting,
FakeSvcLister: remove error return for len(svc)=0.  New test for
predicatePrecomp to make method semantics explictly enforced when meta
is missing. Precompute wrapper.
2016-10-20 08:27:11 -04:00
Kubernetes Submit Queue 6306ab00d2 Merge pull request #34845 from derekwaynecarr/make_pvc_informer_list
Automatic merge from submit-queue

PVC informer lister supports listing

This will be used in follow-on PRs for quota evaluation backed by informers for pvcs.

/cc @deads2k @eparis @kubernetes/sig-storage
2016-10-19 19:29:02 -07:00
Kubernetes Submit Queue 91b7e1f9c3 Merge pull request #34638 from screeley44/k8-get-sc
Automatic merge from submit-queue

Adding default StorageClass annotation printout for resource_printer and describer and some refactoring

adding ISDEFAULT for _kubectl get storageclass_ output

```
[root@screeley-sc1 gce]# kubectl get storageclass
NAME            TYPE                   ISDEFAULT
another-class   kubernetes.io/gce-pd   NO        
generic1-slow   kubernetes.io/gce-pd   YES       
generic2-fast   kubernetes.io/gce-pd   YES       
```

```release-note
Add ISDEFAULT to kubectl get storageClass output
```

@kubernetes/sig-storage
2016-10-19 11:36:08 -07:00
Scott Creeley 86f1a94be5 Adding default StorageClass annotation printout for resource_printer 2016-10-19 10:59:07 -04:00
Kubernetes Submit Queue cd44cec587 Merge pull request #34765 from ivan4th/fix-more-typos
Automatic merge from submit-queue

Fix typos
2016-10-19 00:21:11 -07:00
Clayton Coleman 957c0955aa
Run defaulting on the scheduler startup 2016-10-18 21:07:35 -04:00
Clayton Coleman 1694cfb72d
Make defaulting part of versioning codec
Most normal codec use should perform defaulting. DirectCodecs should not
perform defaulting. Update the defaulting_test to fuzz the list of known
defaulters. Use the new versioning.NewDefaultingCodec() method.
2016-10-18 21:07:35 -04:00
derekwaynecarr 555231fad7 PVC informer lister supports listing 2016-10-18 14:36:33 -04:00
Kubernetes Submit Queue c592a46e16 Merge pull request #28300 from pweil-/psp-seccomp
Automatic merge from submit-queue

Add PSP support for seccomp profiles

Seccomp support for PSP.  There are still a couple of TODOs that need to be fixed but this is passing tests.

One thing of note, since seccomp is all being stored in annotations right now it breaks some of the assumptions we've stated for the provider in terms of mutating the passed in pod.  I've put big warning comments around the pieces that do that to make sure it's clear and covered the rollback in admission if the policy fails to validate.

@sttts @pmorie @erictune @smarterclayton @liggitt
2016-10-18 09:26:09 -07:00
Kubernetes Submit Queue 6e2f5f8f6d Merge pull request #28742 from jessfraz/test-go1.7rc1
Automatic merge from submit-queue

Update to go 1.7

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

Closes #33070
Closes #32999

```release-note
Updated Go to 1.7
```


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

This is to test go version 1.7
2016-10-18 05:59:04 -07:00
Kubernetes Submit Queue bcbdcd17f3 Merge pull request #34685 from resouer/eclass-2
Automatic merge from submit-queue

Refactor scheduler to enable switch on equivalence cache

Part 2 of #30844 

Refactoring to enable easier switch on of equivalence cache.
2016-10-18 04:21:33 -07:00
derekwaynecarr 3c0b35d6b1 Add LimitRange informer 2016-10-17 16:00:26 -04:00
pweil- 49e14744db support seccomp in psp 2016-10-17 14:49:02 -04:00
Kubernetes Submit Queue f90deb2bdd Merge pull request #34829 from deads2k/api-25-gc-admission
Automatic merge from submit-queue

add ownerref permission checks

Adds an admission plugin that ensures that anyone adding an `ownerReference` to a resource has delete rights on the resource they're setting up a delete for.

@caesarxuchao example admission plugin that tests for ownerReference diffs and uses an authorizer to drive the decision.

@liggitt @ncdc we've talked about this before
2016-10-17 09:34:31 -07:00
Harry Zhang 50eaeaa7bd Update ecache and add scheduler method 2016-10-17 11:42:16 -04:00
Kubernetes Submit Queue 65c98dafe0 Merge pull request #34729 from deads2k/rbac-14-admin-role
Automatic merge from submit-queue

add admin,edit,view roles

Adds some more basic roles to bootstrapping and associated tests.
2016-10-17 07:43:10 -07:00
deads2k 14c164a328 add ownerref permission checks 2016-10-17 09:38:05 -04:00
deads2k d56a27f130 add admin,edit,view roles 2016-10-17 09:04:16 -04: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
Kubernetes Submit Queue e5cdc95b85 Merge pull request #34767 from ivan4th/fix-more-typos-1
Automatic merge from submit-queue

Fix typos
2016-10-14 23:30:23 -07:00
Kubernetes Submit Queue cfba438e41 Merge pull request #34084 from ingvagabund/replace-client-with-clientset-in-scheduler-factory
Automatic merge from submit-queue

replace kubeclient with kubeclientset in scheduler factory
2016-10-14 22:09:07 -07:00
Kubernetes Submit Queue 19848dddfd Merge pull request #24980 from aveshagarwal/master-project-node-selector
Automatic merge from submit-queue

Add support for admission controller based on namespace node selectors.

This work is to upstream openshift's project node selectors based admission controller.

Fixes https://github.com/kubernetes/kubernetes/issues/17151
2016-10-14 18:37:33 -07:00
Ivan Shvedunov f1258dca4e Fix typos 2016-10-15 00:21:00 +03:00
Kubernetes Submit Queue c3742a8fbe Merge pull request #34047 from deads2k/rbac-11-informer-cache
Automatic merge from submit-queue

Run rbac authorizer from cache

RBAC authorization can be run very effectively out of a cache.  The cache is a normal reflector backed cache (shared informer).

I've split this into three parts:
 1. slim down the authorizer interfaces
 1. boilerplate for adding rbac shared informers and associated listers which conform to the new interfaces
 1. wiring

@liggitt @ericchiang @kubernetes/sig-auth
2016-10-14 08:12:28 -07:00
Jan Chaloupka 19ab3c6140 replace kubeclient with kubeclientset in scheduler factory
Current factory's client type does not allow to use different client implementing the same interface.
2016-10-14 14:43:43 +02:00
Kubernetes Submit Queue e0fc43b42d Merge pull request #34471 from timothysc/deprecated-scheduler-flags
Automatic merge from submit-queue

Remove scheduler flags that were marked as deprecated 2+ releases ago.

Starting to spin back into scheduler testing and performance evaluation, and I noticed some leftover cleanup work from 2+ releases ago.

**Release note**: Removed unused bind-pods-qps, and bind-pods-burst flags from the scheduler.
2016-10-13 23:51:14 -07:00
Kubernetes Submit Queue f42337f9e8 Merge pull request #34624 from jayunit100/scheduler-checksvc-1
Automatic merge from submit-queue

Minor cleanup to scheduler.

Part 1 of pr for scheduler modularization specifically supporting CheckServiceAffinity improvements #33763.

These are some innoccous changes which help separate the predicate injection machinery from the cleanup parts of CheckServiceAffinity

@timothysc @wojtek-t

- changes to metadata.go are for the follow on pr
- changes to prio/pred stuff is all passing unit tests

hoping to grease this through and then the interesting part is in the follow on pr.
2016-10-13 22:30:49 -07:00
Jess Frazelle d51962e1bb
vet fixes
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-10-13 21:12:15 -07:00
Ivan Shvedunov 2b427f7d59 Fix typos 2016-10-14 00:29:50 +03:00
Avesh Agarwal 5bb2cb8249 Added new unit tests. 2016-10-13 13:15:19 -04:00
Avesh Agarwal b902f857c6 Add support for admission controller based on namespace node selectors.
This work is to upstream openshift's project node selectors based admission controller.

Addresses #17151.
2016-10-13 13:14:19 -04:00
jayunit100 182e89b84e Part 1 of pr #33763: cleanup CheckServiceAffinity in preparation for
predicate injection support, Update metadata struct
2016-10-13 10:38:45 -04:00
deads2k e1638f11a3 run authorization from a cache 2016-10-13 07:53:40 -04:00
deads2k ceaf026881 slim down authorization listing interfaces 2016-10-13 07:50:01 -04:00
Kubernetes Submit Queue ca75b47657 Merge pull request #32555 from pweil-/admission-authorizer
Automatic merge from submit-queue

WantsAuthorizer admission plugin support

The next step of PSP admission is to be able to limit the PSPs used based on user information.  To do this the admission plugin would need to make authz checks for the `user.Info` in the request.  This code allows a plugin to request the injection of an authorizer to allow it to make the authz checks.

Note:  this could be done with a SAR, however since admission is running in the api server using the SAR would incur an extra hop vs using the authorizer directly.

@deads2k @derekwaynecarr
2016-10-13 03:40:11 -07:00
yarntime f21ff43368 add podAntiAffinity test cases 2016-10-13 17:01:58 +08:00
Kubernetes Submit Queue a0d4878ea9 Merge pull request #30145 from markturansky/limit_range_pvc
Automatic merge from submit-queue

Add PVC storage to LimitRange

This PR adds the ability to add a LimitRange to a namespace that enforces min/max on `pvc.Spec.Resources.Requests["storage"]`.

@derekwaynecarr @abhgupta @kubernetes/sig-storage 

Examples forthcoming. 

```release-note
pvc.Spec.Resources.Requests min and max can be enforced with a LimitRange of type "PersistentVolumeClaim" in the namespace
```
2016-10-12 20:26:59 -07:00
pweil- 5c66dcb526 inject authorizer when admission controller requests it 2016-10-12 13:05:34 -04:00
Marcin Wielgus 859077b701 Make "Unschedulable" reason a constant in api 2016-10-12 17:43:24 +02:00
Kubernetes Submit Queue 6f84c9b96e Merge pull request #34071 from liggitt/authz-webhook
Automatic merge from submit-queue

Allow webhook authorizer to use SubjectAccessReviewInterface

Refactors the authorization webhook to be able to be fed a kubeconfig file or a SubjectAccessReviewsInterface 

Added tests to exercise retry logic, and ensure the correct serialized version is sent to the remote webhook (I also made sure the new tests passed on the current webhook impl in master)

c.f. https://github.com/kubernetes/kubernetes/pull/32547
c.f. https://github.com/kubernetes/kubernetes/pull/32518
2016-10-11 23:04:56 -07:00
Kubernetes Submit Queue ec6aba92a7 Merge pull request #34524 from liggitt/x509-chain
Automatic merge from submit-queue

Test x509 intermediates correctly

Fixes #34517
2016-10-11 20:19:10 -07:00
Jordan Liggitt c984744cb1
Test x509 intermediates correctly 2016-10-11 01:48:43 -04:00
deads2k 467b7d928f add clusterrolebindings to bootstrapping 2016-10-10 15:00:35 -04:00
Timothy St. Clair b65af384ba Remove scheduler flags that were marked as deprecated 2+ releases ago. 2016-10-10 13:29:19 -05:00
Kubernetes Submit Queue 074891749b Merge pull request #33724 from guangxuli/k8s_test_oidc
Automatic merge from submit-queue

no need to remove file respectively
2016-10-10 06:16:38 -07:00
Kubernetes Submit Queue 5509e50db4 Merge pull request #31605 from resouer/eclass-1
Automatic merge from submit-queue

[Part 1] Implementation of equivalence pod

Part 1 of #30844

This PR: 

- Refactored `predicate.go`, so that `GetResourceRequest` can be used in other places to `GetEquivalencePod`.
- Implement a `equivalence_cache.go` to deal with all information we need to calculate an equivalent pod.
- Define and register a `RegisterGetEquivalencePodFunction `.

Work in next PR:
- The update of `equivalence_cache.go`
- Unit test
- Integration/e2e test

I think we can begin from the `equivalence_cache.go`? Thanks.  cc @wojtek-t @davidopp 

If I missed any other necessary part, please point it out.
2016-10-10 02:46:00 -07:00
Harry Zhang 204dbe7fdd Update provider and cache
Update equivalent class & remove priority

Use controller ref

Directly clear the cache
2016-10-10 09:25:15 +01:00
Jordan Liggitt 6b3dde745f
Allow webhook authorizer to use SubjectAccessReviewInterface 2016-10-08 01:43:56 -04:00
David Oppenheimer cd4e08e7ec Revert "Add kubelet awareness to taint tolerant match caculator." 2016-10-07 12:10:55 -07:00
Kubernetes Submit Queue 21188cadeb Merge pull request #26501 from resouer/scheduler
Automatic merge from submit-queue

Add kubelet awareness to taint tolerant match caculator.

Add kubelet awareness to taint tolerant match caculator.

Ref: #25320

This is required by `TaintEffectNoScheduleNoAdmit` & `TaintEffectNoScheduleNoAdmitNoExecute `, so that node will know if it should expect the taint&tolerant
2016-10-07 12:05:35 -07:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
gmarek bb71f9473f Small update to scheduler benchmark 2016-10-06 17:26:39 +02:00
Kubernetes Submit Queue 0f40c1a6d0 Merge pull request #34149 from timothysc/prio-hotloop
Automatic merge from submit-queue

Turn down hootloop logs in priorities.  

Excessive spam is output once we near cluster capacity, sometimes a panic is triggered but that data is clipped in the logs see #33935 for more details.
2016-10-06 06:55:00 -07:00
Kubernetes Submit Queue 42e5f95a6b Merge pull request #34024 from deads2k/controller-06-deployment-controller
Automatic merge from submit-queue

update deployment and replicaset listers

Updates the deployment lister to avoid copies and updates the deployment controller to use shared informers.

Pushing WIP to see which tests are broken.
2016-10-06 00:02:34 -07:00
Kubernetes Submit Queue 45e5719c2c Merge pull request #33792 from caesarxuchao/decouple-workqueue-prometheus
Automatic merge from submit-queue

decouple workqueue metrics from prometheus

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:
We want to include the workqueue in client-go, but do not want to having to import Prometheus. This PR decouples the workqueue from prometheus.

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

Partially address https://github.com/kubernetes/kubernetes/issues/33497
User requested for `workqueue` in client-go: https://github.com/kubernetes/client-go/issues/4#issuecomment-249444848

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
The implicit registration of Prometheus metrics for workqueue has been removed, and a plug-able interface was added. If you were using workqueue in your own binaries and want these metrics, add the following to your imports in the main package: "k8s.io/pkg/util/workqueue/prometheus".
```
2016-10-05 22:10:11 -07:00
Timothy St. Clair f2b8b08651 Turn down hootloop logs in priorities. Hit once cluster is near capacity 2016-10-05 16:58:23 -05:00
markturansky 0d40104c1d add pvc storage to LimitRange 2016-10-05 17:31:15 -04:00
deads2k c30b2efc46 update replicaset lister 2016-10-05 15:20:27 -04:00
Kubernetes Submit Queue 7856e46f1b Merge pull request #33967 from xiang90/fix_33772
Automatic merge from submit-queue

scheduler: initialize podsWithAffinity

Without initializing podsWithAffinity, scheduler panics when deleting
a pod from a node that has no pods with affinity ever scheduled to.

Fix #33772
2016-10-05 05:17:51 -07:00
Xiang Li dc62007478 scheduler: cache.delete deletes the pod from node specified in the cached state 2016-10-05 03:33:53 -07:00
Kubernetes Submit Queue 96fde0fe8d Merge pull request #33834 from wojtek-t/scheduler_map_reduce_6
Automatic merge from submit-queue

Migrate EqualPriority in scheduler to map-reduce-like framework

Ref #24246
2016-10-04 09:23:01 -07:00
Jedrzej Nowak d2161c21d7 Fix typos and englishify plugin/pkg 2016-10-04 17:51:14 +02:00
Wojciech Tyczynski f8632e2203 Migrate EqualPriority to MapReduce-like framework. 2016-10-04 12:19:08 +02:00
David Ashpole 0c8a664e50 addressed comments 2016-10-03 11:42:56 -07:00
David Ashpole fed3f37eef Split NodeDiskPressure into NodeInodePressure and NodeDiskPressure 2016-10-03 11:42:56 -07:00
Chao Xu feb0d1daa8 decouple workqueue metrics from prometheus 2016-10-03 11:02:06 -07:00
Kubernetes Submit Queue 3933ddbc9a Merge pull request #33821 from sttts/sttts-sysctl-psp-fixes
Automatic merge from submit-queue

Improve sysctl psp tests

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

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

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-10-03 07:54:24 -07:00
Kubernetes Submit Queue bd97c4b7c8 Merge pull request #33879 from luxas/remove_refs_to_mesos
Automatic merge from submit-queue

Remove old references to contrib/mesos

@deads2k @k82cn @derekwaynecarr
2016-10-01 18:20:10 -07:00
Kubernetes Submit Queue 6a1622a723 Merge pull request #33785 from deads2k/api-16-pass-config-to-hook
Automatic merge from submit-queue

pass loopback config to poststart hooks

Updates post start hooks to take a clientconfig with the new loopback credentials for bootstrapping.

@ericchiang This is a little bit of plumbing, but mainly auth I think.
2016-10-01 10:27:04 -07:00
Lucas Käldström 0bba65ca1a Remove old references to contrib/mesos 2016-10-01 16:46:48 +03:00
Harry Zhang c2cf5bbaf6 Setup e2e test for no admit 2016-10-01 01:07:18 -04:00
Dr. Stefan Schimanski 4cc1e63856 Complete sysctl PSP tests 2016-09-30 17:56:11 +02:00
Dr. Stefan Schimanski a62a64550c Cosmetical fixes for sysctl psp 2016-09-30 17:56:11 +02:00
deads2k 57039cfdfa make well-known users and groups into constants 2016-09-30 10:34:33 -04:00
Wojciech Tyczynski daac9a1869 Remove unnecessary podLister from SelectorSpreading 2016-09-30 15:15:14 +02:00
Kubernetes Submit Queue 448ceb3881 Merge pull request #32862 from wojtek-t/scheduler_map_reduce_4
Automatic merge from submit-queue

Support metadata producer with underlying data.

Ref #24246
2016-09-30 01:30:54 -07:00
Timothy St. Clair 4a9f72b59f Abstraction of endpoints in leaderelection code 2016-09-29 23:42:00 -05:00
deads2k 5080a575ad add anytoken authenticator 2016-09-29 14:14:06 -04:00
Kubernetes Submit Queue d187997c94 Merge pull request #32386 from liggitt/anonymous-authenticated-groups
Automatic merge from submit-queue

Allow anonymous API server access, decorate authenticated users with system:authenticated group

When writing authorization policy, it is often necessary to allow certain actions to any authenticated user. For example, creating a service or configmap, and granting read access to all users

It is also frequently necessary to allow actions to any unauthenticated user. For example, fetching discovery APIs might be part of an authentication process, and therefore need to be able to be read without access to authentication credentials.

This PR:
* Adds an option to allow anonymous requests to the secured API port. If enabled, requests to the secure port that are not rejected by other configured authentication methods are treated as anonymous requests, and given a username of `system:anonymous` and a group of `system:unauthenticated`. Note: this should only be used with an `--authorization-mode` other than `AlwaysAllow`
* Decorates user.Info returned from configured authenticators with the group `system:authenticated`.

This is related to defining a default set of roles and bindings for RBAC (https://github.com/kubernetes/features/issues/2). The bootstrap policy should allow all users (anonymous or authenticated) to request the discovery APIs.

```release-note
kube-apiserver learned the '--anonymous-auth' flag, which defaults to true. When enabled, requests to the secure port that are not rejected by other configured authentication methods are treated as anonymous requests, and given a username of 'system:anonymous' and a group of 'system:unauthenticated'. 

Authenticated users are decorated with a 'system:authenticated' group.

NOTE: anonymous access is enabled by default. If you rely on authentication alone to authorize access, change to use an authorization mode other than AlwaysAllow, or or set '--anonymous-auth=false'.
```

c.f. https://github.com/kubernetes/kubernetes/issues/29177#issuecomment-244191596
2016-09-29 10:47:49 -07:00
guangxuli 528b99e143 no need to remove file respectively 2016-09-29 14:24:58 +08:00
Wojciech Tyczynski 6598c181f7 Support metadata producer with underlying data. 2016-09-28 09:11:18 +02:00
Kubernetes Submit Queue b2c175c758 Merge pull request #33474 from wojtek-t/user_agent_for_master_election
Automatic merge from submit-queue

Set UserAgent in LeaderElection clients.

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

@timothysc - FYI
2016-09-27 22:58:08 -07:00
Kubernetes Submit Queue f1aca3aec0 Merge pull request #32651 from wojtek-t/scheduler_map_reduce_3
Automatic merge from submit-queue

Scheduler map reduce 3

Ref https://github.com/kubernetes/kubernetes/issues/24246
2016-09-27 21:46:04 -07:00
Justin Santa Barbara 54195d590f Use strongly-typed types.NodeName for a node name
We had another bug where we confused the hostname with the NodeName.

To avoid this happening again, and to make the code more
self-documenting, we use types.NodeName (a typedef alias for string)
whenever we are referring to the Node.Name.

A tedious but mechanical commit therefore, to change all uses of the
node name to use types.NodeName

Also clean up some of the (many) places where the NodeName is referred
to as a hostname (not true on AWS), or an instanceID (not true on GCE),
etc.
2016-09-27 10:47:31 -04:00
Wojciech Tyczynski cbcce2c90f Set UserAgent in LeaderElection clients. 2016-09-27 15:22:40 +02:00
Kubernetes Submit Queue 1e7fa1f6cd Merge pull request #33334 from caesarxuchao/copy-auth-plugin
Automatic merge from submit-queue

Copy auth plugin to client-go repo

client-go doesn't copy the [auth plugin](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/client/auth/plugins.go). This causes user cannot access cluster run by GKE. User will see error "No Auth Provider found for name gcp".

This PR fixes this issue. It's marked as WIP because I'll need to rebase after #32906 gets merged. Also, the fix needs to be cherry-picked into 1.4 branch to update client-go/1.4.
2016-09-27 02:30:38 -07:00
Wojciech Tyczynski 4ccb27202c Migrate priority functions with non-trivial reduce function. 2016-09-27 11:27:38 +02:00
Kubernetes Submit Queue 69206f5390 Merge pull request #33296 from deads2k/rbac-09-discovery-role
Automatic merge from submit-queue

add system:discovery role

Adds a role for version negotiation from `kubectl`.

@mlbiam ptal.  If it works for you, I think we can merge it.
@kubernetes/sig-auth fyi
2016-09-27 00:33:03 -07:00
Kubernetes Submit Queue e02b73ff67 Merge pull request #33464 from liggitt/terminating-namespace-check
Automatic merge from submit-queue

Fix cache expiration check

The check for whether an entry in the `forceLiveLookup` cache had expired was backwards. Fixed the logic and added tests
2016-09-26 21:51:34 -07:00
Kubernetes Submit Queue 8b2dfac042 Merge pull request #33489 from liggitt/log-error
Automatic merge from submit-queue

Log test error

We're seeing flakes in this unit test downstream at this point, logging the error would be helpful
2016-09-26 20:34:52 -07:00
Chao Xu e17e0b19ab remove special clientrepo code from main repository gcp plugin
rename plugin/pkg/client/auth/plugins.go package name to auth

add the plugin import line in client-gen

update import_known_versions for release_1_5 clientset

change copy.sh
2016-09-26 15:40:29 -07:00
Jordan Liggitt 0c36c5e556
Add anonymous auth to the auth chain 2016-09-26 17:19:00 -04:00
Jordan Liggitt 174e454874
Allow short-circuiting union auth on error 2016-09-26 17:18:05 -04:00
Jordan Liggitt 0dbcad1763
Add anonymous authenticator 2016-09-26 17:18:05 -04:00
Kubernetes Submit Queue 234be5a1d0 Merge pull request #32575 from wojtek-t/concurrent_priorities
Automatic merge from submit-queue

Compute priorities in parallel

Ref #24246
2016-09-26 09:31:47 -07:00
deads2k 4e2f819695 add tests proving rbac rule matches 2016-09-26 11:27:24 -04:00
deads2k 87ff84a7b0 add system:discovery role 2016-09-26 11:27:24 -04:00
Jordan Liggitt 1812fe70a3
Log test error 2016-09-26 11:21:38 -04:00
Jordan Liggitt 1a43b01d3c
Fix cache expiration check 2016-09-26 10:31:33 -04:00
deads2k b330b0a220 start creating controller SA roles. start with just one 2016-09-26 09:31:36 -04:00
Wojciech Tyczynski ff765ed43b Compute priorities in parallel 2016-09-26 14:33:20 +02:00
Kubernetes Submit Queue 64777d37b6 Merge pull request #33268 from deads2k/client-14-rc-svc-lister
Automatic merge from submit-queue

simplify RC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-23 23:37:15 -07:00
Kubernetes Submit Queue 33eabe675b Merge pull request #33332 from ericchiang/oidc-allow-string-as-group-claim
Automatic merge from submit-queue

oidc authenticator: allow string value as groups claim

Allow the group claim to be a single string instead of an array of
strings. This means the following claim

    {
      "role": "admin"
    }

Will be mapped to the groups

    ["admin"]

cc @kubernetes/sig-auth @mlbiam

closes #33290
2016-09-23 12:41:27 -07:00
deads2k 500959b70c fix RC lister 2016-09-23 08:12:03 -04:00
Kubernetes Submit Queue b2aed32578 Merge pull request #33269 from deads2k/client-15-svc-lister
Automatic merge from submit-queue

simplify svc lister

trying to track down what killed the e2e tests.
2016-09-23 03:10:57 -07:00
Kubernetes Submit Queue 1ef86aa8ab Merge pull request #32906 from caesarxuchao/staging-1.5
Automatic merge from submit-queue

Staging 1.5 client

Created the 1.5 folder and remove the 1.4 folder in the staging area in the master branch.

Content of kubernetes/client-go/1.4 will be pulled from the kubernetes/kubernetes 1.4 branch (https://github.com/kubernetes/contrib/pull/1719)
2016-09-22 19:55:01 -07:00
Eric Chiang 065ddab5d1 oidc authenticator: allow string value as groups claim
Allow the group claim to be a single string instead of an array of
strings. This means the following claim

    {
      "role": "admin"
    }

Will be mapped to the groups

   ["admin"]
2016-09-22 14:23:56 -07:00
Daniel Smith db3e549bd1 more usages of go2idl 2016-09-22 13:42:46 -07:00
Kubernetes Submit Queue 4ab5a76338 Merge pull request #33103 from deads2k/controller-03-kill-non-generatedclient
Automatic merge from submit-queue

switch controller manager to generated clients

Switches the controller manager to generated clients.

@ncdc ptal
2016-09-22 11:37:01 -07:00
Harry Zhang c735921b6f Add no admit on node side
Update generated code

Refactored predicates & restore helper
2016-09-22 10:12:44 -04:00
deads2k 483af28944 fix up service lister 2016-09-22 09:12:37 -04:00
Kubernetes Submit Queue 5af04d1dd1 Merge pull request #32876 from errordeveloper/more-cert-utils
Automatic merge from submit-queue

Refactor cert utils into one pkg, add funcs from bootkube for kubeadm to use

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

We have ended-up with rather incomplete and fragmented collection of utils for handling certificates. It may be worse to consider using `cfssl` for doing all of these things, but for now there is some functionality that we need in `kubeadm` that we can borrow from bootkube. It makes sense to move the utils from bookube into core, as discussed in #31221.

**Special notes for your reviewer**: I've taken the opportunity to review names of existing funcs and tried to make some improvements in that area (with help from @peterbourgon).

**Release note**:

```release-note
NONE
```
2016-09-22 01:29:46 -07:00
Kubernetes Submit Queue c46bc88f04 Merge pull request #31491 from dims/fixes-issue-13598
Automatic merge from submit-queue

Allow secure access to apiserver from Admission Controllers

* Allow options.InsecurePort to be set to 0 to switch off insecure access
* In NewSelfClient, Set the TLSClientConfig to the cert and key files
  if InsecurePort is switched off
* Mint a bearer token that allows the client(s) created in NewSelfClient
  to talk to the api server
* Add a new authenticator that checks for this specific bearer token

Fixes #13598
2016-09-21 21:31:56 -07:00
Antoine Pelisse 938872582e Revert "simplify RC and SVC listers" 2016-09-21 15:49:38 -07:00
Chao Xu a4e62297d6 fix tests 2016-09-21 14:44:39 -07:00
Kubernetes Submit Queue 2d9d84dc64 Merge pull request #32888 from deads2k/client-10-fixup-remaining-listers
Automatic merge from submit-queue

simplify RC and SVC listers

Make the RC and SVC listers use the common list functions that more closely match client APIs, are consistent with other listers, and avoid unnecessary copies.
2016-09-21 04:13:56 -07:00
Kubernetes Submit Queue d17c6b903a Merge pull request #33086 from ivan4th/fix-possible-panic-in-pod-affinity-checker
Automatic merge from submit-queue

Fix possible panic in PodAffinityChecker

In `PodAffinityChecker.getMatchingAntiAffinityTerms()` `affinity.PodAntiAffinity` can be `nil` in this place. This problem occurs e.g. when `nil` is passed as `meta` to `PodAffinityChecker.InterPodAffinityMatches()`.

Stumbled upon it while working on #31136 (someone PTAL at that PR too, I've submitted it a month ago and seemingly no one noticed it), kube-controller-manager was crashing there.
2016-09-21 00:24:44 -07:00
Jordan Liggitt 2b569eeea0
compensate for raft/cache delay in namespace admission 2016-09-21 00:27:27 -04:00
deads2k b83a317003 switch controller manager to generated clientset 2016-09-20 12:53:47 -04:00
Davanum Srinivas 25d4a70827 Allow secure access to apiserver from Admission Controllers
* Allow options.InsecurePort to be set to 0 to switch off insecure access
* In NewSelfClient, Set the TLSClientConfig to the cert and key files
  if InsecurePort is switched off
* Mint a bearer token that allows the client(s) created in NewSelfClient
  to talk to the api server
* Add a new authenticator that checks for this specific bearer token

Fixes #13598
2016-09-20 10:42:21 -04:00
Ivan Shvedunov f758cb418d Fix possible panic in PodAffinityChecker 2016-09-20 15:53:13 +03:00
deads2k 16fbb47189 fix up service lister 2016-09-20 08:24:33 -04:00
deads2k 185a7adf84 fix RC lister 2016-09-20 08:24:32 -04:00
deads2k a2a6423574 separate RESTStorage by API group 2016-09-20 08:00:50 -04:00
deads2k 7d1f13d3e0 add GenericAPIServer posthooks for initialization 2016-09-19 14:58:27 -04:00
Ilya Dmitrichenko 386fae4592
Refactor utils that deal with certs
- merge `pkg/util/{crypto,certificates}`
- add funcs from `github.com/kubernetes-incubator/bootkube/pkg/tlsutil`
- ensure naming of funcs is fairly consistent
2016-09-19 09:03:42 +01:00
Kubernetes Submit Queue 4b5c74eed8 Merge pull request #31859 from resouer/fix-nits
Automatic merge from submit-queue

Fix minor nits in test cases

Found a group of nits when doing #30844, fixed them in a this PR since 30844 requires a long time to review.
2016-09-18 06:27:12 -07:00
deads2k 1943d256d2 make rbac authorizer use rule comparison, not covers 2016-09-16 15:53:42 -04:00
Kubernetes Submit Queue 8c48469213 Merge pull request #32353 from smarterclayton/stable_sort
Automatic merge from submit-queue

Doc page for scheduler is not stable (for man pages)

Need to sort maps that are included in help output
2016-09-16 05:44:33 -07:00
Mike Danese a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
Kubernetes Submit Queue 8c83671789 Merge pull request #32643 from smarterclayton/scheduler_retry
Automatic merge from submit-queue

Exit scheduler retry loop correctly

The error was being eaten and shadowed, which means we would never exit
this loop. This might lead to a goroutine in the scheduler being used
forever without exiting at maximum backoff.

Switched to use the real client to make later refactors easier.

@wojtek-t this may lead to scheduler informer exhaustion - not that familiar with retries
2016-09-15 05:16:16 -07:00
Kubernetes Submit Queue dbdaf2c22b Merge pull request #32597 from liggitt/webhook-re-refactor
Automatic merge from submit-queue

Revert "Revert "Allow webhook authenticator to use TokenReviewsInterface""

Reverts https://github.com/kubernetes/kubernetes/pull/32591 (commit 0a02c8275d)
Readds https://github.com/kubernetes/kubernetes/pull/32547

Holding until GKE webhook authenticator is updated by @cjcullen
2016-09-15 03:56:10 -07:00
Kubernetes Submit Queue 4135988880 Merge pull request #32589 from ericchiang/add-ericchiang-to-owners
Automatic merge from submit-queue

plugin/pkg: add ericchiang to owners for OpenID Connect plugins

On the CoreOS side I'm taking over these components.

@erictune has suggested `pkg/registry/{cluster}role{binding}s/OWNERS` as well but I'd feel more comfortable as a reviewer for those specific parts of RBAC for a couple more cycles since @liggitt and @deads2k have had way more experience in the registry code.

Beyond that the only existing OWNERS files for auth are `pkg/auth/OWNERS` and `plugin/pkg/auth/OWNERS` both of which include @liggitt and @erictune. There's also nothing in the `plugin/pkg/client` path. I'm a little unclear on the implications for future PRs that are assigned to me (e.g. webhook or RBAC reviews).

cc @kubernetes/sig-auth
2016-09-14 13:10:33 -07:00
Kubernetes Submit Queue fc466743a8 Merge pull request #32592 from dims/update-google-cloud-api-imports
Automatic merge from submit-queue

Update Google Cloud API client import paths
2016-09-14 08:39:49 -07:00
Clayton Coleman 4d79030b8d
Exit scheduler retry loop correctly
The error was being eaten and shadowed, which means we would never exit
this loop. This might lead to a goroutine in the scheduler being used
forever without exiting at maximum backoff.

Switched to use the real client to make later refactors easier.
2016-09-14 00:34:14 -04:00
Davanum Srinivas 64efc3a744 Update Google Cloud API client import paths
Bump version of golang.org/x/oauth2
Vendor google.golang.org/cloud/
Vendor google.golang.org/api/
Vendor cloud.google.com/go/compute/
Replace google.golang.org/cloud with cloud.google.com/go/

Fixes #30069
2016-09-13 22:21:06 -04:00
Jordan Liggitt 52c3081f6f
Revert "Revert "Allow webhook authenticator to use TokenReviewsInterface""
This reverts commit 0a02c8275d.
2016-09-13 16:23:17 -04:00
Joe Finney 0a02c8275d Revert "Allow webhook authenticator to use TokenReviewsInterface"
This reverts commit e9914f2c4a.
2016-09-13 11:48:43 -07:00
Eric Chiang 26830b8db9 plugin/pkg: add ericchiang to owners for OpenID Connect plugins 2016-09-13 11:14:16 -07:00
Kubernetes Submit Queue 7ba9660487 Merge pull request #32547 from liggitt/webhook-refactor
Automatic merge from submit-queue

Allow webhook authenticator to use TokenReviewsInterface

Refactors the authentication webhook to be able to be fed a kubeconfig file or a TokenReviewsInterface 

Fixes a bug with webhooks not retrying on 429/500 errors

Related to https://github.com/kubernetes/kubernetes/pull/32518#discussion_r78450170
2016-09-13 10:28:34 -07:00
Wojciech Tyczynski ea943d825e Migrate a bunch of priority functions to map-reduce framework 2016-09-13 13:20:29 +02:00
Kubernetes Submit Queue 8f2f836e4e Merge pull request #32106 from jellonek/fd_leaks
Automatic merge from submit-queue

Ensure that we are closing files.

**What this PR does / why we need it**: In several places we are leaking file descriptors. This could be problematic on systems with low ulimits for them.

**Release note**:
```release-note
```
2016-09-12 23:43:38 -07:00
Jordan Liggitt e9914f2c4a
Allow webhook authenticator to use TokenReviewsInterface 2016-09-13 00:42:02 -04:00
Kubernetes Submit Queue 0b5e024789 Merge pull request #32471 from wojtek-t/use_controller_ref_for_avoid_priority
Automatic merge from submit-queue

Use "controller ref" in NodePreferAvoidPriority 

Ref #28590

@caesarxuchao - FYI
2016-09-12 05:20:20 -07:00
Kubernetes Submit Queue ae839ffc44 Merge pull request #31543 from deads2k/rbac-06-change-role-ref
Automatic merge from submit-queue

Change rbac roleref to reflect the information we want

@liggitt @ericchiang This is a version of https://github.com/kubernetes/kubernetes/pull/31359 which updates the `RoleRef` to be (I think) the type that we want, with a group, resource, and name.

This is **not** backwards compatible with any existing data.  I'm ok with doing this since rbac was considered alpha, but its something to consider.

If we want this instead, I'll close the previous pull (or update it with this content).
2016-09-12 02:01:49 -07:00
Piotr Skamruk dc3674c8d0 Ensure that we are closing files. 2016-09-12 09:33:24 +02:00
Wojciech Tyczynski c8c938c3e0 AvoidPriority using ControllerRef 2016-09-12 08:45:02 +02:00
Kubernetes Submit Queue dd46d19d4d Merge pull request #32186 from zhouhaibing089/typo-fix
Automatic merge from submit-queue

the image policy webhook missing field log

simple and naive fix. :) cc @ecordell
2016-09-11 08:19:25 -07:00
Kubernetes Submit Queue cfe53d14fd Merge pull request #30733 from asalkeld/compat-test
Automatic merge from submit-queue

Update scheduler config file compatibility tests

**What this PR does / why we need it**:
Added missing compatibility tests for scheduler config file options.

**Which issue this PR fixes** 
fixes #30099

**Special notes for your reviewer**:
I came up with the options based on the contents of default.go in each branch.

**Release note**:
```release-note
NONE
```
2016-09-10 03:48:49 -07:00
Kubernetes Submit Queue 9d06efb2d1 Merge pull request #31606 from wojtek-t/scheuler_map_reduce
Automatic merge from submit-queue

POC: MapReduce-like scheduler priority functions

Ref #24246
2016-09-09 14:24:05 -07:00
deads2k 8c788233e7 change rbac roleref type 2016-09-09 09:55:51 -04:00
Clayton Coleman adc3761bfc
Doc page for scheduler is not stable (for man pages)
Need to sort maps
2016-09-09 01:09:36 -04:00
Angus Salkeld 27f1f854ba Update scheduler config file compatibility tests
Co-Authored-By: Jordan Liggitt <jliggitt@redhat.com>
2016-09-09 09:31:46 +10:00
zhouhaibing089 e6b671ab64 the image policy webhook missing field log 2016-09-07 16:11:24 +08:00
deads2k cd5b6cc491 move StorageClass to its own group 2016-09-06 08:41:17 -04: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
Harry Zhang 608e7ce0d4 Fix minor nits in test cases 2016-09-01 05:21:17 -04:00
Wojciech Tyczynski 33c710adf0 MapReduce-like scheduler priority functions 2016-08-31 15:16:10 +02:00
Kubernetes Submit Queue be859b144d Merge pull request #30808 from smarterclayton/no_defaults
Automatic merge from submit-queue

ClientConfig should not default to http://localhost:8080

This changes clientcmd to skip the default cluster, but preserves the
behavior in kubectl. This prevents the possibility of an administrator
misconfiguration in kubelet or other server component from allowing a
third party who can bind to 8080 on that host from potentially
impersonating an API server and gaining root access.

@mikedanese @deads2k this removes the defaulting of http://localhost:8080 for server from everything except kubectl.



```release-note
Kubernetes server components using `kubeconfig` files no longer default to `http://localhost:8080`.  Administrators must specify a server value in their kubeconfig files.
```
2016-08-30 11:33:39 -07:00
Clayton Coleman 06cbb29e9e
ClientConfig should not default to http://localhost:8080
This changes clientcmd to skip the default cluster, but preserves the
behavior in kubectl. This prevents the possibility of an administrator
misconfiguration in kubelet or other server component from allowing a
third party who can bind to 8080 on that host from potentially
impersonating an API server and gaining root access.
2016-08-30 10:43:24 -04: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
Daniel Smith a291846cd1 Revert "Remove deprecated Namespace admission plug-ins" 2016-08-28 10:20:44 -07:00
derekwaynecarr c727fdc81f Remove deprecated namespace admission controllers 2016-08-26 11:14:55 -04:00
Piotr Szczesniak 2fb43eb68c Renamed influxdb to influxdata in Godeps 2016-08-26 14:07:51 +02:00
Kubernetes Submit Queue 785e9f24c5 Merge pull request #31122 from deads2k/add-quota-test
Automatic merge from submit-queue

add quota test for creating update requests

Adding a kube test for https://github.com/kubernetes/kubernetes/pull/30907 as requested in https://github.com/kubernetes/kubernetes/pull/30907#issuecomment-241139913 .
2016-08-25 08:21:50 -07:00
Kubernetes Submit Queue 4ddfc4849a Merge pull request #27180 from sttts/sysctl-implementation
Automatic merge from submit-queue

Add sysctl support

Implementation of proposal https://github.com/kubernetes/kubernetes/pull/26057, feature  https://github.com/kubernetes/features/issues/34

TODO:
- [x] change types.go
- [x] implement docker and rkt support
- [x] add e2e tests
- [x] decide whether we want apiserver validation
- ~~[ ] add documentation~~: api docs exist. Existing PodSecurityContext docs is very light and links back to the api docs anyway: 6684555ed9/docs/user-guide/security-context.md
- [x] change PodSecurityPolicy in types.go
- [x] write admission controller support for PodSecurityPolicy
- [x] write e2e test for PodSecurityPolicy
- [x] make sure we are compatible in the sense of https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api_changes.md
- [x] test e2e with rkt: it only works with kubenet, not with no-op network plugin. The later has no sysctl support.
- ~~[ ] add RunC implementation~~ (~~if that is already in kube,~~ it isn't)
- [x] update whitelist
- [x] switch PSC fields to annotations
- [x] switch PSP fields to annotations
- [x] decide about `--experimental-whitelist-sysctl` flag to be additive or absolute
- [x] decide whether to add a sysctl node whitelist annotation

### Release notes:

```release-note
The pod annotation `security.alpha.kubernetes.io/sysctls` now allows customization of namespaced and well isolated kernel parameters (sysctls), starting with `kernel.shm_rmid_forced`, `net.ipv4.ip_local_port_range`, `net.ipv4.tcp_max_syn_backlog` and `net.ipv4.tcp_syncookies` for Kubernetes 1.4.

The pod annotation  `security.alpha.kubernetes.io/unsafeSysctls` allows customization of namespaced sysctls where isolation is unclear. Unsafe sysctls must be enabled at-your-own-risk on the kubelet with the `--experimental-allowed-unsafe-sysctls` flag. Future versions will improve on resource isolation and more sysctls will be considered safe.
```
2016-08-25 06:21:24 -07:00
Dr. Stefan Schimanski ed36baed20 Add sysctl PodSecurityPolicy support 2016-08-25 13:22:01 +02:00
Kubernetes Submit Queue d12b3429fe Merge pull request #30676 from m1093782566/improve-pod-log-output-format
Automatic merge from submit-queue

[Scheduler] Improve pod log output debuggability

Address issue is #30675

The result of my expirments shows that both `glog.Infof("%v", pod)` and `glog.Infof("%+v", pod)` can't output useful information of a pod, it can only output `kind:"" apiVersion:""`. 

`%#v` can output the whole content of pod, but it seems too much!

So, my opinion is output pod info use the format of `%v` to print`pod.Namespace/pod.Name` instead of the pod **object** in both [here](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/scheduler.go#L96) and [here](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/scheduler.go#L100).

@wojtek-t
2016-08-25 04:05:24 -07:00
Kubernetes Submit Queue ef2718620c Merge pull request #30900 from jsafrane/pvc-admission
Automatic merge from submit-queue

Add admission controller for default storage class.

The admission controller adds a default class to PVCs that do not require any
specific class. This way, users (=PVC authors) do not need to care about
storage classes, administrator can configure a default one and all these PVCs
that do not care about class will get the default one.

The marker of default class is annotation "volume.beta.kubernetes.io/storage-class", which must be set to "true" to work. All other values (or missing annotation) makes the class non-default.

Based on @thockin's code, added tests and made it not to reject a PVC when no class is marked as default.
. 
@kubernetes/sig-storage
2016-08-24 03:32:46 -07:00
Kubernetes Submit Queue 0b5547f462 Merge pull request #30183 from timstclair/aa-psp
Automatic merge from submit-queue

AppArmor PodSecurityPolicy support

Implements the AppArmor PodSecurityPolicy support based on the alpha API proposed [here](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md#pod-security-policy)

This implementation deviates from the original proposal in one way: it adds a separate option for specifying a default profile:
```
apparmor.security.alpha.kubernetes.io/defaultProfileName
```
This has several advantages over the original proposal:

- The default is explicit, rather than implicit on the ordering
- The default can be specified without constraining the allowed profiles
- The allowed profiles can be restricted without specifying a default (requires every pod to explicitly set a profile)

The E2E cluster does not currently enable the PodSecurityPolicy, so I will submit E2E tests in a separate PR.

/cc @dchen1107 @pweil- @sttts @jfrazelle @Amey-D
2016-08-23 03:06:05 -07:00
Matt Liggett c86b84ccc0 Add /eviction subresource.
This is for #12611.
2016-08-22 16:38:00 -07:00
deads2k 9913ebf079 add quota test for creating update requests 2016-08-22 10:36:41 -04:00
Jan Safranek 5f6efefc40 [squash] Rename and move to storageclass/ 2016-08-22 14:11:01 +02:00
Wojciech Tyczynski e9d5be628a Don't validate selector that is already validated 2016-08-22 09:39:32 +02:00
Tim St. Clair 293770ef31
AppArmor PodSecurityPolicy implementation 2016-08-21 23:10:45 -07:00
Kubernetes Submit Queue d9705f85ea Merge pull request #30392 from ericchiang/x509-get-groups-from-org
Automatic merge from submit-queue

x509 authenticator: get groups from subject's organization field

Note that the current X509 tests provide a bunch of certs but no private keys or commands to reproduce the testdata, so the new test case isn't added to the certificate chain.

Closes  #30260

cc @treed @gtank @mikedanese @deads2k  @kubernetes/sig-auth
2016-08-21 13:19:50 -07:00
Kubernetes Submit Queue 4e39800baa Merge pull request #30992 from mwielgus/cluster-autoscaler-alg
Automatic merge from submit-queue

Cluster autoscaler friendly scheduling algorithm

cc: @davidopp
2016-08-20 18:49:24 -07: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
Kubernetes Submit Queue 1de78d5a90 Merge pull request #30631 from ecordell/webhook-admission
Automatic merge from submit-queue

ImagePolicyWebhook Admission Controller

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**: This is an implementation of the [image provenance proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/image-provenance.md). It also includes the API definitions by @Q-Lee from https://github.com/kubernetes/kubernetes/pull/30241

**Special notes for your reviewer**:
Please note that this is the first admission controller to make use of the admission controller config file (`--admission-controller-config-file`). I have defined a format for it but we may want to double check it's adequate for future use cases as well.

The format defined is:

```
{
  "imagePolicy": {
     "kubeConfigFile": "path/to/kubeconfig/for/backend",
     "allowTTL": 50,          # time in s to cache approval
     "denyTTL": 50,           # time in s to cache denial
     "retryBackoff": 500,      # time in ms to wait between retries
     "defaultAllow": true      # determines behavior if the webhook backend fails
  }
}
```

(or yaml)

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Adding ImagePolicyWebhook admission controller.
```
2016-08-20 13:39:44 -07:00
Kubernetes Submit Queue 67adbc419d Merge pull request #30796 from derekwaynecarr/quota-bz
Automatic merge from submit-queue

Quota usage checking ignores unrelated resources

Scenario:

1. Create 4 services
2. Add a quota that limits services to 3
3. Create a pod

Expected result:
pod creation succeeds

Actual result:
pod creation fails stating that services exceed quota.

Fix:
less than or equal check should only verify resources pertinent to request.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1367733
2016-08-20 04:57:05 -07:00
Kubernetes Submit Queue 010c976ce8 Merge pull request #30468 from jlowdermilk/feature-config
Automatic merge from submit-queue

Feature gates for kube-system components

Implements [this proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/runtimeconfig.md). Adds `--feature-gates` to apiserver, scheduler, controller-manager and proxy.

cc @lavalamp @adityakali
2016-08-19 18:15:19 -07:00
Kubernetes Submit Queue 0341d3d358 Merge pull request #30944 from ericchiang/oidc-auth-provider-dont-trim-issuer
Automatic merge from submit-queue

oidc auth provider: don't trim issuer URL

This mirrors a similar side fix for the API server authenticator.
Don't trim the issuer URL provided by the user since OpenID Connect
mandates that this URL exactly matches the URL returned by the
issuer during discovery.

This change only impacts clients attempting to connect to providers that
are non-spec compliant.

No test updates since this is already tested by the go-oidc client
package.

See: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationValidation

Server side fix #29860
Updates #29749

cc @kubernetes/sig-auth @hanikesn
2016-08-19 15:48:46 -07:00
Kubernetes Submit Queue 248e508225 Merge pull request #30609 from m1093782566/update-comment-info
Automatic merge from submit-queue

update comment info for scheduler binding fails

Since the process logic for scheduler binding failed has changed, I think we should update the comment information to avoid make people confused :)

The related issue is #30611.

@wojtek-t What do you think about it ?

Thanks!
2016-08-19 15:47:33 -07:00
Jeff Lowdermilk 51198f59da Add --feature-gates to kube-system components
apiserver,scheduler,controller-manager,proxy,kubelet all get
flag. Using one variable to plumb through config via salt/init
scripts for GCE and GKE
2016-08-19 09:07:43 -07:00
Marcin Wielgus 2df92ff155 Cluster autoscaler friendly scheduling algorithm 2016-08-19 15:20:15 +02:00
Kubernetes Submit Queue 1f3a703df1 Merge pull request #30274 from mwielgus/best-fit
Automatic merge from submit-queue

ClusterAutoscaler-friendly scheduler priority function that promotes well-used nodes

It will help cluster autoscaler to put pods on nodes that are unlikely to be deleted soon due to low usage. Otherwise a pod may be frequently kicked from one node to another. A flag that enables it when CA is on will be added in a separate PR.

Fixes: #28842
2016-08-18 23:49:10 -07:00
Evan Cordell 711e3cff98 Add new admission controller: image policy webhook 2016-08-18 21:59:45 -04:00
Eric Chiang 3d2ee4e7be oidc auth provider: don't trim issuer URL
This mirrors a similar side fix for the API server authenticator.
Don't trim the issuer URL provided by the user since OpenID Connect
mandates that this URL exactly matches the URL returned by the
issuer during discovery.

Not test updates since this is already tested by the go-oidc client
package.

See: https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationValidation
2016-08-18 16:37:50 -07:00
Clayton Coleman 5f8366aac3
Convert() should accept the new conversion Context value
Allows Convert() to reuse the same conversions as ConvertToVersion
without being overly coupled to the version.
2016-08-18 14:45:20 -04:00
Clayton Coleman 12a5eeea17
Introduce GroupVersioner for capturing desired target version
Convert single GV and lists of GVs into an interface that can handle
more complex scenarios (everything internal, nothing supported). Pass
the interface down into conversion.
2016-08-18 14:45:00 -04:00
deads2k 44808c64ae only compute delta on non-creating updates 2016-08-18 13:41:33 -04:00
Jan Safranek 82d35fb461 Add admission controller for default storage class.
The admission controller adds a default class to PVCs that do not require any
specific class. This way, users (=PVC authors) do not need to care about
storage classes, administrator can configure a default one and all these PVCs
that do not care about class will get the default one.
2016-08-18 18:55:35 +02:00
Kubernetes Submit Queue dc588e4451 Merge pull request #30257 from timstclair/aa-psp-annotations
Automatic merge from submit-queue

Add annotations to the PodSecurityPolicy Provider interface

@pweil- is this what you were thinking in terms of API changes? I really like to avoid functions with more than 2 return values, but couldn't think of a cleaner approach in this case.
2016-08-18 07:12:45 -07:00
Kubernetes Submit Queue 214c916045 Merge pull request #30585 from m1093782566/remotve-duplicated-assignment
Automatic merge from submit-queue

remove duplicated nodeinfo.pods assignment

There are duplicated assignments for nodeinfo.pods, one place is [here](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/schedulercache/node_info.go#L139) and the other one is [here](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/schedulercache/node_info.go#L147). 

I think we can remove one.

The related issue is #30610
2016-08-18 01:29:20 -07:00
Marcin Wielgus de2fea95ca ClusterAutoscaler-friendly scheduler priority function that promotes well-used nodes. 2016-08-18 08:34:10 +02:00
derekwaynecarr 307832dbec Quota usage checking ignores unrelated resources 2016-08-17 16:25:25 -04:00
Tim St. Clair c99d7fddc1
Add alpha annotations support to the PodSecurityPolicy provider 2016-08-17 10:14:36 -07:00
m1093782566 40f5d64411 update comment info when scheduler bind fails
Change-Id: Idce89003fe408b713431d07a3300e3acd1af87a9
2016-08-16 20:23:26 +08:00
m1093782566 458f5bd7f2 improve pod log output format
Change-Id: I415dd97f14b507ebb8340eb853f935e1e90b7a53
2016-08-16 17:59:58 +08:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
m1093782566 8f607394ee remove duplicated nodeinfo.pods assignment
Change-Id: I8b15624e1cf146ab1693938bbd6ab1c6be030724
2016-08-14 16:43:45 +08:00
Kubernetes Submit Queue c73b96d66d Merge pull request #25526 from lavalamp/fix-generated-code
Automatic merge from submit-queue

Fix code generators-- make scheme building composable

I needed to make some changes to make my other refactoring possible and this got rather large. 

We now provide a "SchemeBuilder" to help all of the api packages provide their scheme-building functions (addKnownTypes and friends) in a standardized way. This also allows generated deepcopies & conversions to be entirely self contained, the project will now build without them being present (as they can add themselves to the SchemeBuilder). (Although if you actually build without them, you will get reduced performance!)

Previously, there was no way to construct your own runtime.Scheme (e.g., to test), you had to use the api.Scheme object, which has all sorts of non-hermetic cruft in it. Now you can get everything from a package by calling the scheme builder's AddToScheme, including the generated functions, if they are present.

Next steps are to allow for declaring dependencies, and to standardize the registration & install code. (#25434)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/25526)
<!-- Reviewable:end -->
2016-08-11 22:38:29 -07:00
Daniel Smith f1fd638962 fix register.go files up + add test import 2016-08-11 17:06:54 -07:00
derekwaynecarr 5cca4b07c6 Quota admission errors if usage is negative 2016-08-11 11:26:59 -04:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Eric Chiang e5d7f01b91 x509 authenticator: get groups from subject's organization field 2016-08-10 12:32:28 -07:00
Kubernetes Submit Queue f53a35fb76 Merge pull request #29147 from caesarxuchao/cut-client-repo-staging
Automatic merge from submit-queue

Cut the client repo, staging it in the main repo

Tracking issue: #28559
ref: https://github.com/kubernetes/kubernetes/pull/25978#issuecomment-232710174

This PR implements the plan a few of us came up with last week for cutting client into its own repo:
1. creating "_staging" (name is tentative) directory in the main repo, using a script to copy the client and its dependencies to this directory
2. periodically publishing the contents of this staging client to k8s.io/client-go repo
3. converting k8s components in the main repo to use the staged client. They should import the staged client as if the client were vendored. (i.e., the import line should be `import "k8s.io/client-go/<pacakge name>`). This requirement is to ease step 4.
4. In the future, removing the staging area, and vendoring the real client-go repo.

The advantage of having the staging area is that we can continuously run integration/e2e tests with the latest client repo and the latest main repo, without waiting for the client repo to be vendored back into the main repo. This staging area will exist until our test matrix is vendoring both the client and the server.

In the above plan, the tricky part is step 3. This PR achieves it by creating a symlink under ./vendor, pointing to the staging area, so packages in the main repo can refer to the client repo as if it's vendored. To prevent the godep tool from messing up the staging area, we export the staged client to GOPATH in hack/godep-save.sh so godep will think the client packages are local and won't attempt to manage ./vendor/k8s.io/client-go.

This is a POC. We'll rearrange the directory layout of the client before merge.

@thockin @lavalamp @bgrant0607 @kubernetes/sig-api-machinery

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29147)
<!-- Reviewable:end -->
2016-08-09 17:12:14 -07:00
Chao Xu 51c0271e0a added a e2e test that uses the staged client; made necessary changes to gcp auth plugin to pass the gke tests 2016-08-09 14:07:54 -07:00
mksalawa 2749ec7555 Create PredicateFailureReason, modify scheduler predicate interface. 2016-08-09 14:01:46 +02:00
derekwaynecarr a672a986e3 Admission control errors should have consistent lower casing 2016-08-08 10:31:23 -04:00
Kubernetes Submit Queue faffbe4e18 Merge pull request #29622 from rootfs/rbd-ro
Automatic merge from submit-queue

allow a read-only rbd image mounted by multiple pods

allow pod to run read-only rbd volume 
fix #27725
2016-08-07 17:03:39 -07:00
Kubernetes Submit Queue e19ea41a5e Merge pull request #30136 from m1093782566/master
Automatic merge from submit-queue

remove useless value copy

Copy something to values in parameters won't change them in go. So, remove it to avoid making people confused.
2016-08-07 16:06:23 -07:00
Huamin Chen 730db45eab allow a read-only rbd image mounted by multiple pods
Signed-off-by: Huamin Chen <hchen@redhat.com>
2016-08-07 10:32:26 -04:00
Kubernetes Submit Queue 711b63e78b Merge pull request #28104 from ping035627/ping035627-patch-4
Automatic merge from submit-queue

SchedulerExtender: add failedPredicateMap in Filter() returns

Fix #25797. modify extender.Filter for adding extenders information to “failedPredicateMap” in findNodesThatFit.
When all the filtered nodes that passed "predicateFuncs" don’t pass the extenders filter, the failedPredicateMap hasn’t the extenders information, should add it, I think. So when the length of the “filteredNodes.Items” is 0, we can know the integral information. (The length of the “filteredNodes.Items” is 0, may be because the extenders filter failed.)
2016-08-06 20:50:33 -07:00
Chao Xu a771578a1c move pkg/util/ files to their own package to reduce client-go dependencies 2016-08-05 23:32:02 -07:00
Kubernetes Submit Queue 2537f66f0e Merge pull request #29230 from luxas/goimport
Automatic merge from submit-queue

Run goimport for the whole repo

While removing GOMAXPROC and running goimports, I noticed quite a lot of other files also needed a goimport format. Didn't commit `*.generated.go`, `*.deepcopy.go` or files in `vendor`

This is more for testing if it builds.
The only strange thing here is the gopkg.in/gcfg.v1 => github.com/scalingdata/gcfg replace.
cc @jfrazelle @thockin
2016-08-05 16:22:01 -07:00
deads2k 32920b5617 add subjectaccessreviews resource 2016-08-05 11:20:56 -04:00
m1093782566 91f6b7bc2b remove ineffective copy 2016-08-05 20:43:40 +08:00
Kubernetes Submit Queue 353df20854 Merge pull request #29926 from derekwaynecarr/ns_lifecycle_informer
Automatic merge from submit-queue

Move NamespaceLifecycle to use shared informers

This was a follow-up to https://github.com/kubernetes/kubernetes/pull/29634

Moves the `NamespaceLifecycle` plug-in to a shared infomer cache.

/cc @kubernetes/rh-cluster-infra @deads2k @hodovska
2016-08-04 19:22:59 -07:00
Kubernetes Submit Queue 5230bb7a8e Merge pull request #29860 from ericchiang/fix-openid-connect-provider-with-trailing-slash
Automatic merge from submit-queue

oidc authentication plugin: don't trim issuer URLs with trailing slashes

The issuer URL passed to the plugin must identically match the issuer
URL returned by OpenID Connect discovery. However, the plugin currently
trims all trailing slashes from issuer URLs, causing a mismatch. Since
the go-oidc client already handles this case correctly, don't trim the
path.

Closes #29749

cc @hanikesn @kubernetes/sig-auth
2016-08-04 16:25:49 -07:00
derekwaynecarr 4c37a813df Move NamespaceLifecycle to use shared informers 2016-08-04 11:01:09 -04:00
Kubernetes Submit Queue 2ff8280123 Merge pull request #29915 from wojtek-t/prepare_for_controller_ref_in_scheduler
Automatic merge from submit-queue

Prepare for using "ControllerRef" in scheduler

This is part of a PR that I already have to avoid a bunch of rebases in the future (controller ref probably won't happen in 1.4 release).

@davidopp
2016-08-04 02:23:31 -07:00
Kubernetes Submit Queue 5273ac9b94 Merge pull request #29912 from wojtek-t/enable_pod_affinity
Automatic merge from submit-queue

Enable PodAffinity by default in scheduler

Ref #26144

@gmarek - FYI
2016-08-04 01:51:17 -07:00
PingWang 4106eb70b0 modify extends.Filter
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Add docs

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

add docs for ExtenderFilterResult.FailedNodes in types.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Modify the extender.Filter test.

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Update extender_test.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

modify the comments

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

gofmt -s scheduler_interface.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update the comments

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-04 14:03:32 +08:00
Kubernetes Submit Queue 544851a19f Merge pull request #29796 from deads2k/token-review
Automatic merge from submit-queue

Token review endpoint

Unrevert of #28788, which was rolled back because of https://github.com/kubernetes/kubernetes/issues/29375


@cjcullen @wojtek-t I'd like to remerge if possible.  Have we gotten the field checking mentioned here relaxed? https://github.com/kubernetes/kubernetes/pull/28788#discussion_r71918442
2016-08-03 20:48:31 -07:00
deads2k 60dd4a5d26 interesting changes to add tokenreviews endpoint to implement webhook 2016-08-03 08:37:45 -04:00
deads2k 1e7adaa5c0 allow restricting subresource access 2016-08-03 08:19:57 -04:00
Wojciech Tyczynski c092e15edf SelectorSpreading using controllerRef. 2016-08-02 16:24:48 +02:00
k8s-merge-robot ac3e8303f5 Merge pull request #29634 from derekwaynecarr/fix-flake-in-admission
Automatic merge from submit-queue

Fix usage of namespace shared informers in existing admission controllers

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

/cc @liggitt @ncdc
2016-08-02 06:51:17 -07:00
Wojciech Tyczynski 022719b323 Enable PodAffinity by default in scheduler 2016-08-02 15:06:45 +02:00
Lucas Käldström c88a07ce1a Run goimports 2016-08-02 15:12:39 +03:00
Wojciech Tyczynski 4bc410e47a Speedup pod affintiy predicate function 2016-08-02 08:01:04 +02:00
Eric Chiang bc3dc12203 oidc authentication plugin: don't trim issuer URLs with trailing slashes
The issuer URL passed to the plugin must identically match the issuer
URL returned by OpenID Connect discovery. However, the plugin currently
trims all trailing slashes from issuer URLs, causing a mismatch. Since
the go-oidc client already handles this case correctly, don't trim the
path.
2016-08-01 11:23:05 -07:00
derekwaynecarr 0339ef7961 Fix usage of shared informer in namespace admission controllers 2016-08-01 13:40:34 -04:00
k8s-merge-robot 821ff657f9 Merge pull request #27199 from derekwaynecarr/disk_eviction
Automatic merge from submit-queue

Initial support for pod eviction based on disk

This PR adds the following:

1. node reports disk pressure condition based on configured thresholds
1. scheduler does not place pods on nodes reporting disk pressure
1. kubelet will not admit any pod when it reports disk pressure
1. kubelet ranks pods for eviction when low on disk
1. kubelet evicts greediest pod

Follow-on PRs will need to handle:

1. integrate with new image gc PR (https://github.com/kubernetes/kubernetes/pull/27199)
1. container gc policy should always run (will not be launched from eviction, tbd who does that)
  1. this means kill pod is fine for all eviction code paths since container gc will remove dead container
1. min reclaim support will just poll summary provider (derek will do follow-on)
1. need to know if imagefs is same device as rootfs from summary (derek follow-on)

/cc @vishh @kubernetes/sig-node
2016-07-28 20:18:54 -07:00
k8s-merge-robot 27af240d4f Merge pull request #29539 from wojtek-t/optimize_pod_affinity_3
Automatic merge from submit-queue

Optimize PodAffinity priority function
2016-07-28 16:59:30 -07:00
derekwaynecarr 0de1e62b30 modify fsStats to fsStatsType to avoid confusion with cadvisor types 2016-07-28 16:01:38 -04:00
derekwaynecarr 9604b47c13 Scheduler does not place pods on nodes that have disk pressure 2016-07-28 16:01:38 -04:00
Wojciech Tyczynski d3b9d583a2 Optimize PodAffinity priority function. 2016-07-28 16:57:28 +02:00
Wojciech Tyczynski 898a6444e3 Return pointer for Affinity in api helper 2016-07-28 16:57:28 +02:00
k8s-merge-robot e008087e0a Merge pull request #29457 from derekwaynecarr/service-node-port-quota-fix
Automatic merge from submit-queue

Quota was not counting services with multiple nodeports properly

```release-note
If a service of type node port declares multiple ports, quota on "services.nodeports" will charge for each port in the service.
```

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

/cc @kubernetes/rh-cluster-infra @sdminonne
2016-07-27 18:09:40 -07:00
k8s-merge-robot 3301f6d14f Merge pull request #29356 from smarterclayton/init_containers
Automatic merge from submit-queue

LimitRanger and PodSecurityPolicy need to check more on init containers

Container limits not applied to init containers. HostPorts not checked on podsecuritypolicy

@pweil- @derekwaynecarr
2016-07-27 16:09:34 -07:00
Wojciech Tyczynski a63cccfafc Cache pods with pod (anti)affinity constraints 2016-07-27 17:31:53 +02:00
derekwaynecarr 09c97a2acc Disable flaky unit test in admission plugin in NamespaceAutoProvision 2016-07-26 17:36:14 -04:00
k8s-merge-robot df2cf16ddb Merge pull request #26709 from hodovska/master
Automatic merge from submit-queue

Allow shareable resources for admission control plugins.

Changes allow admission control plugins to share resources. This is done via new PluginInitialization structure. The structure can be extended for other resources, for now it is an shared informer for namespace plugins (NamespiceLifecycle, NamespaceAutoProvisioning, NamespaceExists).

If a plugins needs some kind of shared resource e.g. client, the client shall be added to PluginInitializer and Wants methods implemented to every plugin which will use it.
2016-07-22 11:07:05 -07:00