Commit Graph

1067 Commits (ca00e596bdc7521a096311b3ae44e2731e0910be)

Author SHA1 Message Date
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
derekwaynecarr 305411b59b Fix bug in node port counting in quota not counting multi-node ports 2016-07-22 13:56:55 -04:00
k8s-merge-robot 6fd685b54b Merge pull request #29207 from fgrzadkowski/ha_master_leader_elect
Automatic merge from submit-queue

Add default leader election for scheduler and controller manager.

#21124
2016-07-22 04:49:44 -07:00
Wojciech Tyczynski fad876b6f9 PodAffinity code refinements 2016-07-22 08:49:28 +02:00
Dominika Hodovska 037d116add Factory for SharedIndexInformers 2016-07-21 14:04:48 +02:00
k8s-merge-robot 9b1f3efab4 Merge pull request #29261 from wojtek-t/improve_scheduler_throughput
Automatic merge from submit-queue

Improve scheduler throughput

Ref #28590

This improves scheduler throughput by another 10-15%.

@davidopp @kubernetes/sig-scheduling
2016-07-21 03:16:15 -07:00
Wojciech Tyczynski 4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
Wojciech Tyczynski fc6d38baa2 Avoid locking when computing predicates. 2016-07-21 08:21:07 +02:00
Wojciech Tyczynski cab7db3a64 Use []*api.Node instead of NodeLister in priority functions. 2016-07-21 08:21:07 +02:00
Clayton Coleman 522930b39d
Init containers are not respected in initial resources
Seeds init containers just like regular containers
2016-07-20 23:19:38 -04:00
Clayton Coleman 51f4d7c5fb
Container limits are not applied to InitContainers
InitContainers should be checked against limit rangers
2016-07-20 23:19:38 -04:00
Clayton Coleman affd79fdc0
InitContainers are not checked for hostPort ranges
PodSecurityPolicy must verify that host port ranges are guarded on init
containers.
2016-07-20 23:19:34 -04:00
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
mksalawa fea8d0aebf Fix generic scheduler test 2016-07-20 14:47:44 +02:00
Dominika Hodovska fc0a3c6dcb Allow shareable resources for admission control plugins 2016-07-20 12:53:52 +02:00
Filip Grzadkowski 69e9786383 Change defaults for leader election for scheduler and controller manager 2016-07-20 11:36:15 +02:00
Davanum Srinivas ee8507a5ae Use Infof/Warningf when appropriate
When we use a format string, we should use Infof/Warningf instead
of Info/Warning
2016-07-19 12:10:53 -04:00
k8s-merge-robot 4466531382 Merge pull request #29094 from luxas/gomaxproc
Automatic merge from submit-queue

Remove GOMAXPROCS() calls because they are unnecessary


Now we're setting GOMAXPROCS when every binary starts up, but we don't have to do that anymore, since we've upgraded to Go 1.6

Documentation for it:

> func GOMAXPROCS(n int) int

> GOMAXPROCS sets the maximum number of CPUs that can be executing simultaneously and returns the previous setting. If n < 1, it does not change the current setting. The number of logical CPUs on the local machine can be queried with NumCPU. This call will go away when the scheduler improves. 

A simple program to prove it's unnecessary:

```go
package main
import (
    "fmt"
    "runtime"
)
func main(){
    numCPUBefore := runtime.GOMAXPROCS(runtime.NumCPU())
    numCPUAfter := runtime.GOMAXPROCS(runtime.NumCPU())
    fmt.Println(numCPUBefore, numCPUAfter)
}
```

Output with Go 1.4.2: `1 4`
Output with Go 1.6.2: `4 4`

So I think we should remove calls to GOMAXPROCS now, and it should be pretty straightforward

@thockin @wojtek-t @gmarek @lavalamp @vishh
2016-07-19 08:11:24 -07:00
k8s-merge-robot 9a7507c4db Merge pull request #29186 from wojtek-t/cleanup_resource_request
Automatic merge from submit-queue

Reuse existing Resource struct instead of new resourceRequest

@davidopp
2016-07-19 07:31:19 -07:00
k8s-merge-robot b0bcb8f7b2 Merge pull request #29100 from wojtek-t/pods_can_never_be_scheduled_again
Automatic merge from submit-queue

Fix disappearing pods in scheduler

Fix #29098
2016-07-19 03:26:16 -07:00
Wojciech Tyczynski dcb5a6d1a6 Reuse existing Resource struct instead of new resourceRequest 2016-07-19 12:21:09 +02:00
Lucas Käldström 88ea80b572 Remove GOMAXPROCS() calls because they are unnecessary 2016-07-19 11:08:21 +03:00
Wojciech Tyczynski 66009877bc Fix disappearing pods in scheduler 2016-07-19 08:18:04 +02:00
k8s-merge-robot a049a97820 Merge pull request #28803 from lukaszo/ds
Automatic merge from submit-queue

Make Daemonset use GeneralPredicates

fixes: #21454 #22205
2016-07-18 22:12:14 -07:00
k8s-merge-robot 8d46d9b0c7 Merge pull request #28281 from nhlfr/authorize-return-bool
Automatic merge from submit-queue

Return (bool, error) in Authorizer.Authorize()

Before this change, Authorize() method was just returning an error, regardless of whether the user is unauthorized or whether there is some other unrelated error. Returning boolean with information about user authorization and error (which should be unrelated to the authorization) separately will make it easier to debug.

Fixes #27974
2016-07-18 21:40:26 -07:00
k8s-merge-robot 6d09ba41e9 Merge pull request #29044 from lixiaobing10051267/masterWebHook
Automatic merge from submit-queue

Func note not consistent with real fun name

File "plugin\pkg\webhook.go", line #41 :
"// New creates a new GenericWebhook from the provided kubeconfig file."
Here "New" not consistant with real fun name "NewGenericWebhook" in line #42 :
"func NewGenericWebhook(kubeConfigFile string, groupVersions []unversioned.GroupVersion, initialBackoff time.Duration) (*GenericWebhook, error) {"
2016-07-18 10:13:05 -07:00
k8s-merge-robot fa174bcdaf Merge pull request #29042 from dims/fixup-imports
Automatic merge from submit-queue

Use Go canonical import paths

Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-18 07:23:38 -07:00
Michal Rostecki fa0dd46ab7 Return (bool, error) in Authorizer.Authorize()
Before this change, Authorize() method was just returning an error,
regardless of whether the user is unauthorized or whether there
is some other unrelated error. Returning boolean with information
about user authorization and error (which should be unrelated to
the authorization) separately will make it easier to debug.

Fixes #27974
2016-07-18 12:06:54 +02:00
Wojciech Tyczynski 78101ac55e Fix crashes in schedulercache 2016-07-18 10:04:36 +02:00
k8s-merge-robot 156205523d Merge pull request #28852 from deads2k/use-user
Automatic merge from submit-queue

authorize based on user.Info

Update the `authorization.Attributes` to use the `user.Info` instead of discrete getters for each piece.

@kubernetes/sig-auth
2016-07-16 20:12:43 -07:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
lixiaobing10051267 3dfdb1dbb3 Func note not consistent with real fun name 2016-07-16 10:25:01 +08:00
k8s-merge-robot 4374b090c3 Merge pull request #28958 from wojtek-t/optimize_priorities_5
Automatic merge from submit-queue

Few more optimizations of priority functions in scheduler

Ref #28590

@davidopp
2016-07-15 09:32:04 -07:00
k8s-merge-robot 8b2d994153 Merge pull request #28952 from wojtek-t/optimize_pod_affinity
Automatic merge from submit-queue

First step of optimizing PodAffinity priority function

Ref #26144 

This is obviously only a first step - I will continue working on this code. However, this is changing the general scheme of computations to what is described in: https://github.com/kubernetes/kubernetes/issues/26144#issuecomment-232612384
2016-07-15 08:59:17 -07:00
Wojciech Tyczynski a538045d7b Cleanup and prepare for optimizing PodAffinity priority function. 2016-07-15 10:06:36 +02:00
Wojciech Tyczynski a23f7bd556 Few more optimizations of priority functions in scheduler 2016-07-14 15:32:56 +02:00
k8s-merge-robot 6bb0995c89 Merge pull request #28886 from wojtek-t/fix_schedulercache_bug
Automatic merge from submit-queue

Add ForgetPod to SchedulerCache

Fix #28883

@gmarek @davidopp @xiang90
2016-07-14 05:30:23 -07:00
k8s-merge-robot 74c5b4e4be Merge pull request #28459 from ping035627/ping035627-patch-0704
Automatic merge from submit-queue

Optimise the process of the CalculateSpreadPriority in selector_spreading.go

It had better inspect if the nodeLister is normal first in the CalculateSpreadPriority in selector_spreading.go. If the nodeLister.List return error, the function return directly, not need deal the serviceLister and controllerLister and replicaSetLister.
2016-07-14 04:54:32 -07:00
deads2k f6f1ab34aa authorize based on user.Info 2016-07-14 07:48:42 -04:00
k8s-merge-robot ae990defcf Merge pull request #26956 from joe2far/fix-typos
Automatic merge from submit-queue

Fixed several typos
2016-07-14 04:13:15 -07:00
k8s-merge-robot 06939c57aa Merge pull request #20699 from jiangyaoguo/add-AvoidPreviousNode
Automatic merge from submit-queue

Implement alpha version of PreferAvoidPods

This is part of #18853

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/20699)
<!-- Reviewable:end -->
2016-07-14 03:30:25 -07:00
PingWang e4ab32cde2 Modify CalculateAntiAffinityPriority function
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-14 09:10:50 +08:00
PingWang 437e133b34 Optimise the process of the CalculateSpreadPriority in selector_spreading.go
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-14 09:09:05 +08:00
Wojciech Tyczynski 9745878778 Add ForgetPod to SchedulerCache 2016-07-13 16:30:05 +02:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
Łukasz Oleś 528bf7af3a Make Daemonset use GeneralPredicates
fixes #21454, fixes #22205
2016-07-13 14:50:29 +02:00
Wojciech Tyczynski c929d95884 Cache Allocatable Resources 2016-07-13 12:57:18 +02:00
Wojciech Tyczynski 58c201834c Unify resources 2016-07-13 12:57:07 +02:00
jiangyaoguo 4e91166bc6 Use PreferAvoidPods annotation to avoid pods being scheduled to specific node.
1. define PreferAvoidPods annotation
2. add PreferAvoidPodsPriority
3. validate AvoidPods in node annotations
2016-07-13 17:07:46 +08:00
Wojciech Tyczynski ea1d797f98 Avoid computing ports multiple times 2016-07-13 11:02:26 +02:00
Wojciech Tyczynski ae6b66207a Optimize selector spreading 2016-07-13 11:02:26 +02:00
Wojciech Tyczynski b9d13c5dbd Avoid computing pod resources multiple times 2016-07-13 11:01:53 +02:00
kevin-wangzefeng ff6280fa5b update inter-pod affinity predicates, check PodAntiAffinity even when pod has no AntiAffinity constraints 2016-07-13 03:55:01 +00:00
k8s-merge-robot 5590553811 Merge pull request #28304 from ericchiang/fix-rbac-non-resource-url-rule-evaluation
Automatic merge from submit-queue

rbac authorizer: cleanups to rule evaluation for non-resource URLs

An few oversights in the RBAC authorizer. Fixes #28291 and permits non-resource URLs to use stars in the path. E.g. ("/apis/*").

cc @liggitt @kubernetes/sig-auth
2016-07-12 15:30:50 -07:00
Eric Chiang addc4b166c rbac authorizer: support non-resource urls with stars ("/apis/*") 2016-07-12 10:01:53 -07:00
Eric Chiang 411922f66c rbac authorizer: include verb in non-resource url requests 2016-07-12 10:01:53 -07:00
k8s-merge-robot 5894dc4615 Merge pull request #28829 from gmarek/hooks
Automatic merge from submit-queue

Add hooks for cluster health detection

Separate a function that decides if zone is healthy. First real commit for preventing massive pod eviction.
Ref. #28832

cc @davidopp
2016-07-12 08:12:04 -07:00
k8s-merge-robot 98030ded05 Merge pull request #28781 from wojtek-t/optimize_priorities_2
Automatic merge from submit-queue

Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance



Currently copies that are made while copying/creating api.NodeList are significant part of scheduler profile, and a bunch of them are made in places, that are not-parallelizable.
Ref #28590
2016-07-12 06:18:15 -07:00
gmarek fd600ab65c Add hooks for cluster health detection 2016-07-12 15:10:58 +02:00
k8s-merge-robot 9b5827691a Merge pull request #28669 from lixiaobing10051267/masterTestPodFitsResources
Automatic merge from submit-queue

Add test case to TestPodFitsResources() of scheduler algorithm

File "plugin\pkg\scheduler\algorithm\predicates", function "TestPodFitsResources()", line 199, only provide test case "one resource cpu fits but memory not", it should add test case "one resource memory fits but cpu not".
2016-07-11 22:46:09 -07:00
Wojciech Tyczynski d14fe0f269 Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance 2016-07-11 21:02:33 +02:00
k8s-merge-robot 5067af159e Merge pull request #28715 from euank/kubelet-trim-dead-code
Automatic merge from submit-queue

kubelete: delete a few bits of dead code

Less is more.
2016-07-11 11:40:47 -07:00
k8s-merge-robot 9b74e24fa3 Merge pull request #28769 from wojtek-t/optimize_priorities
Automatic merge from submit-queue

Optimize priorities in scheduler

Ref #28590

It's probably easier to review it commit by commit, since those changes are kind of independent from each other.

@davidopp - FYI
2016-07-11 07:49:23 -07:00
Wojciech Tyczynski d02e8d2885 Avoid unnecessary conversions 2016-07-11 15:41:27 +02:00
Wojciech Tyczynski dcb2ca54ad Avoid unnecessary copies 2016-07-11 15:41:27 +02:00
Wojciech Tyczynski 989202c384 Cache AllowedPodNumber to avoid conversions. 2016-07-11 15:41:26 +02:00
Wojciech Tyczynski 4eed5e07a5 Precompute pod resources 2016-07-11 15:41:26 +02:00
Wojciech Tyczynski e8e8e2d086 Remove unneeded factories 2016-07-11 15:41:26 +02:00
lixiaobing10051267 ce83c04251 Error info "scheduler" modify 2016-07-11 15:17:43 +08:00
PingWang 4fde2ff3a5 Update CheckServiceAffinity in predicates.go
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

gofmt -s -w

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-11 09:57:57 +08:00
k8s-merge-robot a261776f3e Merge pull request #28670 from wojtek-t/scheduler_metadata
Automatic merge from submit-queue

Add meta field to predicate signature to avoid computing the same things multiple times

This PR only uses it to avoid computing QOS of a pod for every node from scratch.

Ref #28590
2016-07-09 22:28:14 -07:00
k8s-merge-robot 91226f77a1 Merge pull request #28680 from wojtek-t/advanced_node_info_map_copy
Automatic merge from submit-queue

Avoid creating NodeInfoMap from scratch on every scheduling.

Ref #28590
2016-07-09 03:03:05 -07:00
k8s-merge-robot 9a4cc9979a Merge pull request #28504 from deads2k/allow-quota-injection
Automatic merge from submit-queue

allow lock acquisition injection for quota admission

Allows for custom lock acquisition when composing the quota admission controller.

@derekwaynecarr I'm still experimenting to make sure this satisfies the need downstream, but looking for agreement in principle
2016-07-08 17:15:39 -07:00
Euan Kemp 26e0f50504 kubelet: delete unused code 2016-07-08 15:15:43 -07:00
Wojciech Tyczynski 49934c05c0 Avoid creating NodeInfoMap from scratch on every scheduling. 2016-07-08 18:09:49 +02:00
Wojciech Tyczynski 0e6dc8a932 Avoid unnecessary copies 2016-07-08 13:54:06 +02:00
Wojciech Tyczynski b1d53895a4 Check only predicate functions in test 2016-07-08 13:01:41 +02:00
Wojciech Tyczynski b92eadfd1a Avoid computing QOS multiple times 2016-07-08 12:57:40 +02:00
Wojciech Tyczynski 6890868823 Add meta field to predicates signature 2016-07-08 12:25:48 +02:00
lixiaobing10051267 b4c106426e Add test case to TestPodFitsResources() 2016-07-08 15:43:03 +08:00
Wojciech Tyczynski 31538db145 Avoid growing slices 2016-07-07 15:54:39 +02:00
Wojciech Tyczynski 6c77c01f24 Avoid copying nodes in priority functions 2016-07-07 14:38:09 +02:00
Wojciech Tyczynski 7219802ac7 Pass pointer to node in NodCondition 2016-07-07 14:10:17 +02:00
Wojciech Tyczynski 58c95c136f Quick returns in predicates 2016-07-07 12:34:54 +02:00
k8s-merge-robot 0c696dc95b Merge pull request #27848 from liubin/fix-typos
Automatic merge from submit-queue

fix some typos

Just a minor typos fix.


Signed-off-by: bin liu <liubin0329@gmail.com>
2016-07-06 23:36:49 -07:00
k8s-merge-robot 4d91f0f763 Merge pull request #25137 from huang195/tls_user_emailaddress
Automatic merge from submit-queue

getting emailAddress from TLS cert

Kubernetes if using TLS cert to perform authentication will use the CommonName field of the cert as the authenticating user. In https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/auth/authenticator/request/x509/x509.go#L106, alternative methods are defined to use emailAddress or DNSName as the authenticating user. The method that uses the emailAddress is not comprehensive as this information can be encoded in different places of the certificate. This PR fixes this.
2016-07-06 19:45:01 -07:00
deads2k ada37c2163 allow lock acquisition injection for quota admission 2016-07-06 09:39:42 -04:00
Hongchao Deng 7127915a66 selector: make sure value of GT and LT is integer 2016-07-04 20:18:17 -07:00
bin liu 426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
k8s-merge-robot 038ac428f4 Merge pull request #28036 from ericchiang/oidc-auth-plugin-dont-error-if-provider-is-unavailable
Automatic merge from submit-queue

oidc auth plugin: don't hard fail if provider is unavailable

When using OpenID Connect authentication, don't cause the API
server to fail if the provider is unavailable. This allows
installations to run OpenID Connect providers after starting the
API server, a common case when the provider is running on the
cluster itself.

Errors are now deferred to the authenticate method.

cc @sym3tri @erictune @aaronlevy @kubernetes/sig-auth
2016-06-30 13:02:16 -07:00
k8s-merge-robot 61a9358dbd Merge pull request #26774 from xiangpengzhao/fix_predicatesnil
Automatic merge from submit-queue

Check nil pointer in predicates.go

Should check if the pointer is nil in func filterVolumes as is done in [func predicate](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/algorithm/predicates/predicates.go#L279).
2016-06-30 01:45:26 -07:00
Eric Chiang 2f6db37ff5 oidc auth plugin: don't hard fail if provider is unavailable
When using OpenID Connect authentication, don't cause the API
server to fail if the provider is unavailable. This allows
installations to run OpenID Connect providers after starting the
API server, a common case when the provider is running on the
cluster itself.

Errors are now deferred to the authenticate method.
2016-06-29 23:20:26 -07:00
k8s-merge-robot 9e0a2d3a6b Merge pull request #28203 from ping035627/ping035627-0629
Automatic merge from submit-queue

Add error log for Run function in server.go

When clientcmd.BuildConfigFromFlags and os.Hostname return error, there are no log information in Run function, neither did the upper function(main of scheduler), add it, I suggest.
2016-06-29 21:03:05 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot e7f7a49bac Merge pull request #26016 from hongchaodeng/phantom
Automatic merge from submit-queue

scheduler: change phantom pod test from integration into unit test

This is an effort for #24440.

Why this PR?
- Integration test is hard to debug. We could model the test as a unit test similar to [TestSchedulerForgetAssumedPodAfterDelete()](132ebb091a/plugin/pkg/scheduler/scheduler_test.go (L173)). Currently the test is testing expiring case, we can change that to delete.
- Add a test similar to TestSchedulerForgetAssumedPodAfterDelete() to test phantom pod.
- refactor scheduler tests to share the code between TestSchedulerNoPhantomPodAfterExpire() and TestSchedulerNoPhantomPodAfterDelete()
- Decouple scheduler tests from scheduler events: not to use events
2016-06-29 12:09:49 -07:00
k8s-merge-robot 7f3da674f7 Merge pull request #26680 from olegshaldybin/fake-clientset-registry
Automatic merge from submit-queue

Track object modifications in fake clientset

Fake clientset is used by unit tests extensively but it has some
shortcomings:

- no filtering on namespace and name: tests that want to test objects in
  multiple namespaces end up getting all objects from this clientset,
  as it doesn't perform any filtering based on name and namespace;

- updates and deletes don't modify the clientset state, so some tests
  can get unexpected results if they modify/delete objects using the
  clientset;

- it's possible to insert multiple objects with the same
  kind/name/namespace, this leads to confusing behavior, as retrieval is
  based on the insertion order, but anchors on the last added object as
  long as no more objects are added.

This change changes core.ObjectRetriever implementation to track object
adds, updates and deletes.

Some unit tests were depending on the previous (and somewhat incorrect)
behavior. These are fixed in the following few commits.
2016-06-29 06:04:33 -07:00
k8s-merge-robot 1a1a4709b9 Merge pull request #28093 from dubstack/dubstack-refactor-qos2
Automatic merge from submit-queue

[Refactor] Make QoS naming consistent across the codebase

@derekwaynecarr @vishh PTAL. Can one of you please attach a LGTM.
2016-06-29 02:36:22 -07:00
PingWang 989416b329 Add error log for Run function in server.go
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-06-29 11:11:52 +08:00
Oleg Shaldybin 3b15d5be19 Use correct namespace in unit tests that use fake clientset
Fake clientset no longer needs to be prepopulated with records: keeping
them in leads to the name conflict on creates. Also, since fake
clientset now respects namespaces, we need to correctly populate them.
2016-06-28 11:26:34 -07:00
deads2k a28cf3963b refactor quota evaluation to cleanly abstract the quota access 2016-06-28 11:38:18 -04:00
k8s-merge-robot b6f966f8f5 Merge pull request #27690 from resouer/fix-affinity
Automatic merge from submit-queue

Omit invalid affinity error in admission

Fixes #27645  cc @smarterclayton 

Not sure if this is too aggressive, but user should expect failure if they disable validation after all.
2016-06-28 02:24:22 -07:00
xiangpengzhao 5b69688b4b Check nil for pointer 2016-06-27 22:55:20 -04:00
Buddha Prakash 4acb64f8bd Make Qos naming consistent across the codebase 2016-06-26 16:19:47 -07:00
k8s-merge-robot d64333419c Merge pull request #27749 from dubstack/dubstack-refactor-qos
Automatic merge from submit-queue

[Refactor] QOS to have QOS Class type for QoS classes

This PR adds a QOSClass type and initializes QOSclass constants for the three QoS classes.
It would be good to use this in all future QOS related features. 
This would be good to have for the (Pod level cgroups isolation proposal)[https://github.com/kubernetes/kubernetes/pull/26751] that i am working on aswell.
@vishh PTAL
 
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-06-26 06:23:23 -07:00
k8s-merge-robot 4e6e4ee1f9 Merge pull request #25934 from ping035627/ping035627-patch-3
Automatic merge from submit-queue

Fix  #25606: Add the length detection of the "predicateFuncs" in generic_scheduler.go

Fix  #25606

The PR add the length detection of the "predicateFuncs" for "findNodesThatFit" function of generic_scheduler.go. 
In “findNodesThatFit” function, if the length of the "predicateFuncs" parameter is 0, it can set filtered equals nodes.Items, and needn't to traverse the nodes.Items.
2016-06-25 03:04:44 -07:00
k8s-merge-robot 19650207a2 Merge pull request #24678 from ericchiang/log_webhook_error
Automatic merge from submit-queue

plugin/pkg/auth/authorizer/webhook: log request errors

Currently the API server only checks the errors returned by an
authorizer plugin, it doesn't return or log them[0]. This makes
incorrectly configuring the wehbook authorizer plugin extremely
difficult to debug.

Add a logging statement if the request to the remove service fails
as this indicates misconfiguration.

[0] https://goo.gl/9zZFv4

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24678)
<!-- Reviewable:end -->
2016-06-24 21:43:36 -07:00
k8s-merge-robot 2d35871569 Merge pull request #24385 from Clarifai/fixes
Automatic merge from submit-queue

golint fixes for AWS cloudprovider

Among other things, golint doesn't like receivers that are inconsistently named or called "self". Or structs named aws.AWSservices, aws.AWSCloud, etc.
2016-06-24 20:58:49 -07:00
Hongchao Deng 8cd55e8e52 refactor scheduler test and include phantom test 2016-06-24 16:11:59 -07:00
Buddha Prakash c3551ae6cd Refactor qos package
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-06-24 15:36:04 -07:00
Rudi Chiarito 8db551f674 golint fixes for aws cloudprovider 2016-06-24 17:06:38 -04:00
k8s-merge-robot a405df4391 Merge pull request #25710 from xiangpengzhao/fix_predicate
Automatic merge from submit-queue

No need to log empty string in predicates.go

If `pvcName` is empty, we don't need to log it.
2016-06-24 13:56:26 -07:00
CJ Cullen 38a1042199 Add a 5x exponential backoff on 429s & 5xxs to the webhook Authenticator/Authorizer. 2016-06-23 18:15:39 -07:00
CJ Cullen ae67a4e209 Check HTTP Status code in webhook authorizer/authenticator. 2016-06-22 11:15:33 -07:00
k8s-merge-robot cd66fb7a55 Merge pull request #27772 from jsafrane/kubelet-volume-not-found
Automatic merge from submit-queue

Rephrase 'pv not found in cache' warnings.

When kubelet starts a pod that refers to non-existing PV, PVC or Node, it should clearly show that the requested element does not exist.

Previous `PersistentVolumeClaim 'default/ceph-claim-wm' is not in cache` looks like random kubelet hiccup, while `PersistentVolumeClaim 'default/ceph-claim-wm' not found` suggests that the object may not exist at all and it might be an user error.

Fixes #27523
2016-06-22 05:16:02 -07:00
bin liu fd27cd47f7 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 18:14:26 +08:00
k8s-merge-robot 07471cf90f Merge pull request #27553 from justinsb/pvc_zone_spreading_2
Automatic merge from submit-queue

AWS/GCE: Spread PetSet volume creation across zones, create GCE volumes in non-master zones

Long term we plan on integrating this into the scheduler, but in the
short term we use the volume name to place it onto a zone.
    
We hash the volume name so we don't bias to the first few zones.
    
If the volume name "looks like" a PetSet volume name (ending with
-<number>) then we use the number as an offset.  In that case we hash
the base name.
2016-06-22 01:22:16 -07:00
Harry Zhang 49fe9d1b41 Add unit test to ensure no error thrown 2016-06-21 22:23:37 -04:00
Jan Safranek c9a60e2d2c Rephrase 'pv not found in cache' warnings.
When kubelet starts a pod that refers to non-existing PV, PVC or Node, it
should clearly show that the requested element does not exist.

Previous "PersistentVolumeClaim 'default/ceph-claim-wm' is not in cache"
looks like random kubelet hiccup, while "PersistentVolumeClaim
'default/ceph-claim-wm' not found" suggests that the object may not exist at
all and it might be an user error.

Fixes #27523
2016-06-21 14:56:11 +02:00
Harry Zhang 080b49276e Omit invalid affinity error in admission 2016-06-21 11:06:34 +08:00
k8s-merge-robot 6fbf99b11a Merge pull request #26753 from ericchiang/rbac-authorizer-tests
Automatic merge from submit-queue

add unit and integration tests for rbac authorizer

This PR adds lots of tests for the RBAC authorizer. 

The plan over the next couple days is to add a lot more test cases.

Updates #23396

cc @erictune
2016-06-19 19:19:08 -07:00
k8s-merge-robot 090e6ff660 Merge pull request #27625 from goltermann/spell2
Automatic merge from submit-queue

Fix several spelling errors in comments

What the title says
2016-06-18 23:08:28 -07:00
Justin Santa Barbara 9c2566572d GCE Multizone: Allow volumes to be created in non-master zone
We had a long-lasting bug which prevented creation of volumes in
non-master zones, because the cloudprovider in the volume label
admission controller is not initialized with the multizone setting
(issue #27656).

This implements a simple workaround: if the volume is created with the
failure-domain zone label, we look for the volume in that zone.  This is
more efficient, avoids introducing a new semantic, and allows users (and
the dynamic provisioner) to create volumes in non-master zones.

Fixes #27657
2016-06-17 23:27:41 -04:00
k8s-merge-robot 8b7d842203 Merge pull request #27227 from abhgupta/issue_27198
Automatic merge from submit-queue

Counting pod volume towards PV limit even if PV/PVC is missing

Fixes #27198 

Implements option 3 from https://github.com/kubernetes/kubernetes/issues/27198#issuecomment-225298492

/cc @smarterclayton @markturansky @childsb
2016-06-17 12:40:51 -07:00