Commit Graph

181 Commits (ba535d57f6e2eb338f6fbf121d6be2e6f9204136)

Author SHA1 Message Date
Shijun Qin 158257473a
Fix a grammatical error in a comment
Fix a grammatical error in a comment in scheduler's code. We should use a word's plural form after "one of".
2018-03-02 21:30:44 +08:00
Kubernetes Submit Queue ae1fc13aee
Merge pull request #60386 from k82cn/k8s_60163
Automatic merge from submit-queue (batch tested with PRs 60683, 60386). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Added unschedulabe predicate.

Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>

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

**Release note**:
```release-note
None
```
2018-03-02 03:41:50 -08:00
Yang Guo 8d880506fe Support cluster-level extended resources in kubelet and kube-scheduler
Co-authored-by: Yang Guo <ygg@google.com>
Co-authored-by: Chun Chen <chenchun.feed@gmail.com>
2018-02-27 17:25:30 -08:00
jennybuckley c8dacd8e63 Run hack/update-all.sh 2018-02-26 17:16:14 -08:00
Da K. Ma dac59e4dd1 Added unschedulabe predicate.
Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>
2018-02-25 14:00:59 +08:00
Kubernetes Submit Queue 755ab974e1
Merge pull request #58835 from ravisantoshgudimetla/critical-pod-with-priority
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Critical pod priorityClass addition

**What this PR does / why we need it**:
@bsalamat - Apologies for the delay. This PR is to ensure that all pods with priorityClassName `system-node-critical` and `system-cluster-critical` will be critical pods while preserving backwards compatibility.

**Special notes for your reviewer**:

- Moved some constants and other data structures to scheduler/api/types.go where other constants are present.
- An automatic assignment of critical priorities to pods based on critical pod annotation for backwards compatibility including some unit tests. 
xref:  https://github.com/kubernetes/kubernetes/issues/57471 

**Release note**:

```release-note
Critical pods to use priorityClasses.
```
2018-02-23 11:22:31 -08:00
Kubernetes Submit Queue 49a1478839
Merge pull request #60263 from tossmilestone/reuse-minNodes
Automatic merge from submit-queue (batch tested with PRs 60106, 59510, 60263, 60063, 59088). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Reuse the `min*Nodes` slices in order to save GC time

**What this PR does / why we need it**:
Reuse the `min*Nodes` slices to save GC time when executing `pickOneNodeForPreemption`.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-02-23 02:59:47 -08:00
tossmilestone 5a083f2038 Reuse the "min*Nodes" slices to save the GC time. 2018-02-23 14:16:19 +08:00
Kubernetes Submit Queue a195a76151
Merge pull request #59952 from resouer/consts-handler
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use consts as predicate key names in handlers

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

Per discussion in: https://github.com/kubernetes/kubernetes/pull/59335/files#r168351460

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Use consts as predicate name in handlers
```
2018-02-22 15:45:16 -08:00
ravisantoshgudimetla 68c20ad770 Critical pods priorityClass addition 2018-02-21 20:53:21 -05:00
Bobby (Babak) Salamat 08406c3f6e Make the `Unschedulable Queue` interface private 2018-02-21 13:53:40 -08:00
Bobby (Babak) Salamat 5a00c42848 Minor improvements to scheduling queue 2018-02-21 12:57:28 -08:00
Kubernetes Submit Queue fe4b28cdf0
Merge pull request #60062 from bsalamat/sched_q_imprv
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve scheduling queue's logic

**What this PR does / why we need it**:
Improves scheduling queue's code based on some recent comments on [the original PR](https://github.com/kubernetes/kubernetes/pull/55109).
This PR does not fix any bugs or make any change of behavior.

**Release note**:

```release-note
NONE
```

/sig scheduling
2018-02-20 20:00:25 -08:00
Bobby (Babak) Salamat bba9b12d0c Improve scheduling queue's logic 2018-02-20 17:20:55 -08:00
Kubernetes Submit Queue 6ba46963f8
Merge pull request #59391 from msau42/topology-beta
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move volume scheduling and local storage to beta

**What this PR does / why we need it**:
* Move the feature gates and APIs for volume scheduling and local storage to beta
* Update tests to use the beta fields
@kubernetes/sig-storage-pr-reviews 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
ACTION REQUIRED: VolumeScheduling and LocalPersistentVolume features are beta and enabled by default.  The PersistentVolume NodeAffinity alpha annotation is deprecated and will be removed in a future release.
```
2018-02-20 13:26:07 -08:00
Kubernetes Submit Queue 5b98dbcfe5
Merge pull request #60008 from k82cn/k8s_54313_2
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Taint node when it under PID pressure.

Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>

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

**Release note**:
```release-note
If TaintNodesByCondition enabled, taint node when it under PID pressure 
```
2018-02-20 03:13:28 -08:00
Kubernetes Submit Queue 96ec318718
Merge pull request #59842 from ixdy/update-rules_go-02-2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Update bazelbuild/rules_go, kubernetes/repo-infra, and gazelle dependencies

**What this PR does / why we need it**: updates our bazelbuild/rules_go dependency in order to bump everything to go1.9.4. I'm separating this effort into two separate PRs, since updating rules_go requires a large cleanup, removing an attribute from most build rules.

**Release note**:

```release-note
NONE
```
2018-02-19 22:23:05 -08:00
Kubernetes Submit Queue 6d0b71740f
Merge pull request #59968 from kubernetes/revert-59323-nodetaint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Revert "add node shutdown taint"

Reverts kubernetes/kubernetes#59323

Node becomes unready, but is never removed. I've found the following in [kube-controller-manager.log](https://storage.googleapis.com/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce-autoscaling/6055/artifacts/bootstrap-e2e-master/cluster-autoscaler.log) from test run for one such node:

`E0216 01:14:27.084923       1 node_lifecycle_controller.go:686] Error determining if node bootstrap-e2e-minion-group-01b1 shutdown in cloud: failed to get instance ID from cloud provider: instance not found`

This goes on for the rest of the run (~6h). Looks like the node is stuck in Unready state because of this check: https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/nodelifecycle/node_lifecycle_controller.go#L684. Previously, there was no such check and the node was removed.

Reverting as this would affect all users attempting to resize their node groups on GCE.

```release-note
NONE
```
2018-02-16 20:12:56 -08:00
Da K. Ma 6bda1bec6e Taint node when it under PID pressure.
Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>
2018-02-17 10:55:29 +08:00
Da K. Ma 4df591fc5d Updated comments to correct flag of taint.
Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>
2018-02-17 10:01:25 +08:00
Michelle Au c7884550b2 Add VolumeNodeAffinity to PersistentVolumeSpec 2018-02-16 17:54:10 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Aleksandra Malinowska 2d54ba3e0f
Revert "add node shutdown taint" 2018-02-16 12:24:27 +01:00
Harry Zhang 136e5398ed Use consts as predicate name in handlers 2018-02-15 15:18:27 -08:00
Kubernetes Submit Queue 27daaab224
Merge pull request #59323 from zetaab/nodetaint
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add node shutdown taint

**What this PR does / why we need it**: we need node stopped taint in order to detach volumes immediately without waiting timeout. More info in issue ticket #58635 

**Which issue(s) this PR fixes** 
Fixes #58635

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-15 09:52:10 -08:00
Kubernetes Submit Queue 4949b63e0a
Merge pull request #59335 from resouer/equiv-vol
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixes volume predicate handler for equiv class

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

Per discussion in #58797 , we are missing some predicate handler in factory.go.

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

Ref #58222

**Special notes for your reviewer**:

Kindly ping @msau42

**Release note**:

```release-note
Fixes volume predicate handler for equiv class
```
2018-02-14 20:57:08 -08:00
Kubernetes Submit Queue 01bd3c4b74
Merge pull request #59734 from mlmhl/format_imports
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Format some import statements in scheduler pkg

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

As the title says, apply `goimports` on some files under `pkg/scheduler` pkg.

**Release note**:

```release-note
NONE
```
2018-02-13 08:04:15 -08:00
Kubernetes Submit Queue ba791275ce
Merge pull request #59671 from bsalamat/sched_queue_perf
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve performance of scheduling queue by adding a hash map to track all pods with a nominatedNodeName

**What this PR does / why we need it**:
Our investigations show that there is a performance regression in the new scheduling queue which is not enabled by default and is enabled only if "priority and preemption" which is an alpha feature is enabled. This PR is an important performance improvement for those who want to use priority and preemption in larger clusters.
The PR adds a hash table to track nominated Pods so that finding such Pods will be faster.
Other than improving performance, we don't expect this PR to change behavior of scheduler.

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

ref/ #56032
ref/ #57471 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig scheduling
2018-02-13 00:07:58 -08:00
Kubernetes Submit Queue 821cf9234d
Merge pull request #59246 from huangjiuyuan/scheduler/add-tests-for-schedulercache
Automatic merge from submit-queue (batch tested with PRs 59479, 59246). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add tests for schedulercache

**What this PR does / why we need it**:
Add tests for `node_info.go` under `schedulercache` package.

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

**Special notes for your reviewer**:

**Release note**:
```
NONE
```
2018-02-12 17:14:31 -08:00
Kubernetes Submit Queue ab2e1cb02a
Merge pull request #59479 from tossmilestone/avoid-ecahe-update-race
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Avoid race condition when updating equivalence cache

**What this PR does / why we need it**:
Lock the ecache to update the ecache on each predicate running, to avoid race condition.

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

**Special notes for your reviewer**:
None

**Release note**:

```release-note
None
```
2018-02-12 16:38:07 -08:00
Bobby (Babak) Salamat df5fc09411 compare Pods by UID, not by name and namespace 2018-02-12 10:13:13 -08:00
mlmhl b3fff71161 format some import statements in scheduler pkg 2018-02-12 09:04:00 +08:00
Kubernetes Submit Queue 74089bc4bb
Merge pull request #58737 from NickrenREN/fix-scheduler-ephemeral-storage
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Subtract local ephemeral storage resource from NodeInfo when removing pod

**What this PR does / why we need it**:
When we are removing pods, we need to subtract local ephemeral storage resource from NodeInfo

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

**Special notes for your reviewer**:

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

/kind bug
/sig storage
/sig scheduling

/assign @jingxu97  @bsalamat
2018-02-11 13:43:01 -08:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Jesse Haka 6665fa7144 taint also node controller
fix function

fix gofmt

fix function return value

fix tests

skip notimplemented error

remove factory unused

in openstack we should try to find instanceid from all states instead of ACTIVE, all other cloudproviders do this already

fix tests and lint

fix gofmt

fix nodelifecycletest

fix lint errors
2018-02-10 15:41:24 +02:00
huangjiuyuan 7d12796297 Add tests for schedulercache 2018-02-10 16:24:16 +08:00
NickrenREN 6e44d9522c release local ephemeral storage resource when removing pod 2018-02-10 11:36:11 +08:00
Bobby (Babak) Salamat 69d62a9288 Improve performance of scheduling queue by adding a hash map to track all pods in with a nominatedNodeName. 2018-02-09 14:07:29 -08:00
tossmilestone e155582662 Avoid race condition when updating equivalence cache. 2018-02-09 16:26:41 +08:00
Jesse Haka 3cf5b172fa add node shutdown taint
shutdowned -> stopped

use shutdown everywhere

use patch in taints api call

use notimplemented in clouds use AddOrUpdateTaintOnNode

correct log text

add fake cloud

try to fix bazel

add shutdown tests

add context
2018-02-08 12:56:06 +02:00
tossmilestone 3fdacfead5 Fix golint errors in `pkg/scheduler` based on golint check 2018-02-08 15:22:47 +08:00
Kubernetes Submit Queue 5a4b160cf0
Merge pull request #59281 from bsalamat/nominated_node
Automatic merge from submit-queue (batch tested with PRs 59010, 59212, 59281, 59014, 59297). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Replace nominateNodeName annotation with PodStatus.NominatedNodeName

**What this PR does / why we need it**:
Replaces nominateNodeName annotation with PodStatus.NominatedNodeName in scheudler's logic. We don't expect any logic/behavior changes.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

ref #57471

/sig scheduling
cc: @k82cn @aveshagarwal @resouer
2018-02-07 15:27:43 -08:00
Kubernetes Submit Queue f72f90f624
Merge pull request #59449 from aveshagarwal/master-rhbz-1540822
Automatic merge from submit-queue (batch tested with PRs 58444, 59283, 59437, 59325, 59449). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix to register priority function ResourceLimitsPriority correctly.

**What this PR does / why we need it**:
This PR fixes registration of priority function ResourceLimitsPriority.  Previously this function was being registered inside `init()`. Since this priority function ResourceLimitsPriority is behind feature gate `ResourceLimitsPriorityFunction` and if the feature is enabled, it was not visible in `init()` function. So now the registration of this priority function is moved inside `ApplyFeatureGates()` in scheduler where it can be correctly registered after the feature has been enabled.


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

**Special notes for your reviewer**:

**Release note**:

```release-note

None
```

@kubernetes/sig-scheduling-pr-reviews @bsalamat @ravisantoshgudimetla
2018-02-06 22:42:45 -08:00
Kubernetes Submit Queue 7223729d51
Merge pull request #59245 from resouer/equiv-node
Automatic merge from submit-queue (batch tested with PRs 59394, 58769, 59423, 59363, 59245). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Ensure euqiv hash calculation is per schedule

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

Currently, equiv hash is calculated per schedule, but also, per node. This is a potential cause of dragging integration test, see #58881

We should ensure this only happens once during scheduling of specific pod no matter how many nodes we have.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Ensure euqiv hash calculation is per schedule
```
2018-02-06 21:34:48 -08:00
Avesh Agarwal a450116cc1 Fix to register priority function ResourceLimitsPriority correctly. 2018-02-06 20:08:11 -05:00
Harry Zhang 482dc31937 Ensure euqiv hash calculation per schedule 2018-02-06 14:42:39 -08:00
Yang Guo f69eaa3b18 kube-scheduler: Use default predicates/prioritizers if policy config does not specify them 2018-02-06 13:01:33 -08:00
Harry Zhang bff62d2c86 Equiv class volume fixes
Generated bazel
2018-02-05 16:58:43 -08:00
Kubernetes Submit Queue bdde196191
Merge pull request #58999 from tanshanshan/scheduler-msg
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make predicate errors more human readable

**What this PR does / why we need it**:
Make predicate errors more human readable

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

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-02-02 13:36:23 -08:00
Bobby (Babak) Salamat ec69dd139b autogenerated files 2018-02-02 13:06:33 -08:00