Commit Graph

125 Commits (750881c0ab62a9f59d53582bc33826caa167aa83)

Author SHA1 Message Date
zhangmingld 3648f73337 fix some typo 2018-09-21 10:20:21 +08:00
Jordan Liggitt 761ac275b8
Coerce componentconfig/v1alpha1 KubeSchedulerConfiguration to kubescheduler.config.k8s.io/v1alpha1 2018-09-14 14:40:22 -04:00
Michelle Au e124159990 Add scheduler option for bind timeout 2018-09-04 17:25:23 -07:00
Kubernetes Submit Queue f3b98a08b0
Merge pull request #66799 from noqcks/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Add validation for kube-scheduler configuration options

**What this PR does / why we need it**: This adds validation to the kube-scheduler so that we're not accepting bogus values to the kube-scheduler. As requested by @bsalamat in issue https://github.com/kubernetes/kubernetes/issues/66743

**Which issue(s) this PR fixes**:
Fixes #66743

**Special notes for your reviewer**:
- Not sure if this validation is too heavy handed. Would love some feedback. 
- I started working on this before I realized @islinwb was also working on this same problem... https://github.com/kubernetes/kubernetes/pull/66787 I put this PR up anyways since I'm sure good code exists in both. I wasn't aware of the /assign command so didn't assign myself before starting work. 
- I didn't have time to work on adding validation to deprecated cli options. If the rest of this looks ok, I can finish that up.
- I hope the location of IsValidSocketAddr is correct. Lmk if it isn't. 

**Release note**:
```release-note
Adding validation to kube-scheduler at the API level
```
2018-09-03 17:17:49 -07:00
noqcks 0334a34e4a
Add validation for kube-scheduler
adding validation for componentconfig

adding validation to cmd kube-scheduler

Add support for ipv6 in IsValidSocketAddr function

updating copyright date in componentconfig/validation/validation.go

updating copyright date in componentconfig/validation/validation_test.go

adding validation for cli options

adding BUILD files

updating validate function to return []errors in cmd/kube-scheduler

ok, really returning []error this time

adding comments for exported componentconfig Validation functions

silly me, not checking structs along the way :'(

refactor to avoid else statement

moving policy nil check up one function

rejigging some deprecated cmd validations

stumbling my way around validation slowly but surely

updating according to review from @bsalamat

- not validating leader election config unless leader election is enabled
- leader election time values cannot be zero
- removing validation for KubeConfigFile
- removing validation for scheduler policy

leader elect options should be non-negative

adding test cases for renewDeadline and leaseDuration being zero

fixing logic in componentconfig validation 😅

removing KubeConfigFile reference from tests as it was removed in master

2ff9bd6699

removing bogus space after var assignment

adding more tests for componentconfig based on feedback

making updates to validation because types were moved on master

update bazel build

adding validation for staging/apimachinery

adding validation for staging/apiserver

adding fieldPaths for staging validations

moving staging validations out of componentconfig

updating test case scenario for staging/apimachinery

./hack/update-bazel.sh

moving kube-scheduler validations from componentconfig

./hack/update-bazel.sh

removing non-negative check for QPS

resourceLock required

adding HardPodAffinitySymmetricWeight 0-100 range to cmd flag help section
2018-08-31 22:29:19 -04:00
Kubernetes Submit Queue 9ea0f6c729
Merge pull request #67756 from tizhou86/newPR1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Add function comment to fix golint error in cmd/kube-scheduler/app.

**What this PR does / why we need it**:
Add function comment to fix golint error in cmd/kube-scheduler/app.

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

**Special notes for your reviewer**:
NONE

**Release note**:

```release-note
NONE
```
2018-08-31 08:58:05 -07:00
tanshanshan d6b3dcf5ab make error info clearly 2018-08-28 15:56:55 +08:00
tizhou86 e0a6d6bd32 Add function comment to fix golint error in cmd/kube-scheduler/app. 2018-08-28 11:15:50 +08:00
Di Xu 7f8a59162b auto-generated 2018-08-24 10:58:09 +08:00
Di Xu 7c68c585f4 use external KubeSchedulerConfiguration 2018-08-24 10:58:09 +08:00
Bobby (Babak) Salamat abb70aee98 Add a scheduler config argument to set the percentage of nodes to score 2018-08-17 11:18:51 -07:00
Dr. Stefan Schimanski c2724793e8 Update bazel 2018-08-17 08:57:21 +02:00
Dr. Stefan Schimanski 1d9a896066 apiserver: move controller-manager's insecure config into apiserver 2018-08-17 08:56:46 +02:00
Jordan Liggitt 13de114286
Add test for scheduler config defaults 2018-08-16 10:39:19 -04:00
Lucas Käldström db855a2b2d
autogenerated 2018-08-14 19:02:18 +03:00
Lucas Käldström 4bef926218
Remove references to the config structs that have moved to their own shared packages 2018-08-14 19:02:06 +03:00
Kubernetes Submit Queue 6274590518
Merge pull request #66656 from wackxu/fixappversion
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 apps/v1 version for scheduler

/kind cleanup

**Release note**:

```release-note
NONE
```
2018-08-11 23:25:33 -07:00
Lucas Käldström 2ff9bd6699
Rename the KubeConfigFile field to Kubeconfig in ClientConnectionConfiguration 2018-08-08 22:25:55 +03:00
xushiwei 00425595 fed8572745 use apps/v1 version for scheduler 2018-07-26 17:37:29 +08:00
Dr. Stefan Schimanski fe310525db apiserver: allow high ports in secure serving validation 2018-07-04 19:20:12 +02:00
Kubernetes Submit Queue d5803e596f
Merge pull request #65731 from bsalamat/cfg_no_warn
Automatic merge from submit-queue (batch tested with PRs 65040, 65731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove scheduler config deprecated warning as the new component config is still in alpha

**What this PR does / why we need it**:
The new scheduler's component config file (API) is still in alpha. We shouldn't push users to use the alpha feature as it may change in the future and the changes may not be backward compatible.

**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
```

/sig scheduling
2018-07-02 23:24:05 -07:00
Kubernetes Submit Queue 47020f3318
Merge pull request #65094 from hzxuzhonghu/le-client-timeout
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). 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>.

set leader election client and renew timeout

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

set leader-election client timeout

set timeout for tryAcquireOrRenew

**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 #65090 #65257

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 18:19:05 -07:00
Bobby (Babak) Salamat 68fff1a1fc Remove scheduler config deprecated warning as the new component config is still in alpha 2018-07-02 16:51:05 -07:00
Kubernetes Submit Queue 7786bd8c9a
Merge pull request #64654 from atlassian/missing-error-handling
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 missing error handling in schema-related code

**What this PR does / why we need it**:
Adds missing error handling to a few places.

**Which issue(s) this PR fixes**
Updates #51457. Still more work to do to fix the issue - client generation code needs to be updated (addressed in https://github.com/kubernetes/kubernetes/pull/64664).

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

/kind bug
/sig api-machinery
2018-07-02 07:14:34 -07:00
xuzhonghu 90b287c12d leaderelection: set timeout for tryAcquireOrRenew 2018-06-30 10:38:53 +08:00
xuzhonghu 7c6213e922 set leader election client timeout 2018-06-29 10:32:31 +08:00
Jordan Liggitt 14d31aff48
fix scheduler client construction from configuration files 2018-06-26 20:37:15 -04:00
Mikhail Mazurskiy bfe313d5f3
Add missing error handling in schema-related code 2018-06-23 21:06:32 +10:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Kubernetes Submit Queue 5e8b64f990
Merge pull request #65238 from deads2k/scheduler-01-boundary
Automatic merge from submit-queue (batch tested with PRs 65187, 65206, 65223, 64752, 65238). 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 scheduler port boundary to match detection

zero is allowed to disable the port.  Fix boundary check to allow it.

```release-note
NONE
```

No release note because if we fix it in time, nothing was wrong.
2018-06-21 19:48:18 -07:00
David Eads e8f7739e8d fix scheduler port boundary to match detection 2018-06-19 16:26:49 -04:00
Mikhail Mazurskiy 102090d1f1
Use context.TODO() to be explicit that cancellation is not implemented 2018-06-07 14:33:03 +10:00
Mikhail Mazurskiy 3252beb02b
Propagate signal from stop to context 2018-06-07 14:24:02 +10:00
Mikhail Mazurskiy dc32a341c0
Cancellable leader election with context 2018-06-07 14:24:02 +10:00
Mikhail Mazurskiy 1d99fff1ac
Cancellable leader election with channels 2018-06-07 14:24:01 +10:00
Krzysztof Siedlecki 0e833bfc83 Fixing scheduling latency metrics 2018-05-30 11:20:12 +02:00
xuzhonghu be2a234af5 fix little bug in kube-scheduler options 2018-05-17 16:59:39 +08:00
Dr. Stefan Schimanski e333ba061f scheduler: remove nested retry loops 2018-05-15 13:09:55 +02:00
Dr. Stefan Schimanski a3a52a8cf7 Revert "Revert "scheduler: align with ctrl-managers and apiservers, add https+auth in options""
This reverts commit 7b93d81a97.
2018-05-15 13:09:55 +02:00
Wojciech Tyczynski 7b93d81a97
Revert "scheduler: align with ctrl-managers and apiservers, add https+auth in options" 2018-05-03 21:05:00 +02:00
Dr. Stefan Schimanski 24bc981918 Update bazel 2018-04-28 22:36:13 +02:00
Dr. Stefan Schimanski 2af0bdb00f scheduler: add https+authn+authz to options, set to nil for now 2018-04-28 22:36:13 +02:00
Dr. Stefan Schimanski abc8c98e35 scheduler: align plumbing with controller-manager and apiservers 2018-04-28 22:36:13 +02:00
Bobby (Babak) Salamat a073dfdbd9 Fix scheduler Pod informers to receive events when pods are scheduled by other schedulers. 2018-04-23 11:07:53 -07:00
Kubernetes Submit Queue 1e39d68ecb
Merge pull request #62243 from resouer/fix-62068
Automatic merge from submit-queue (batch tested with PRs 59592, 62308, 62523, 62635, 62243). 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>.

Separate pod priority from preemption

**What this PR does / why we need it**:
Users request to split priority and preemption feature gate so they can use priority separately.

**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 #62068 

**Special notes for your reviewer**:

~~I kept use `ENABLE_POD_PRIORITY` as ENV name for gce cluster scripts for backward compatibility reason. Please let me know if other approach is preffered.~~

~~This is a potential **break change** as existing clusters will be affected, we may need to include this in 1.11 maybe?~~

TODO: update this doc https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/

[Update] Usage: in config file for scheduler:
```yaml
apiVersion: componentconfig/v1alpha1
kind: KubeSchedulerConfiguration
...
disablePreemption: true
```

**Release note**:

```release-note
Split PodPriority and PodPreemption feature gate
```
2018-04-19 14:50:27 -07:00
Kubernetes Submit Queue 2c54e9ca74
Merge pull request #62515 from resouer/fix-58805
Automatic merge from submit-queue (batch tested with PRs 62481, 62643, 61877, 62515). 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 write-config-to to scheduler

**What this PR does / why we need it**:
Scheduler should be able to write its default configure to file. This actually applies to all components which claims options other than `--config` will be deprecated.

Otherwise, users will be super confused to find out how to write a proper config file to these components.

See: https://stackoverflow.com/questions/47966440/how-to-create-a-config-file-for-kube-scheduler-to-use-by-the-config-argument
ref: #52562

**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 #58805

Usage:

```bash
./_output/bin/kube-scheduler --write-config-to /tmp/kube-scheduler.yaml
```

**Special notes for your reviewer**:
This should have been fixed several releases ago, so lets include it in 1.11

**Release note**:

```release-note
Add write-config-to to scheduler
```
2018-04-18 17:53:19 -07:00
Harry Zhang 3e918c5885 Update generated bazel 2018-04-17 11:02:33 -07:00
Harry Zhang c88cd33cf5 Add write-config-to to scheduler
Change to write provided values if config is set
2018-04-17 11:02:31 -07:00
Matthieu Maquevice c5378a5f7c
wording 2018-04-17 09:28:32 +02:00
Harry Zhang 4f0bd4121e Disable pod preemption by config 2018-04-12 21:11:51 -07:00
Kubernetes Submit Queue 3fa28cb0e0
Merge pull request #62236 from zhangxiaoyu-zidif/fix-caps-on-schedulerName
Automatic merge from submit-queue (batch tested with PRs 61147, 62236, 62018). 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>.

spec.SchedulerName should be spec.schedulerName in kube-scheduler help

**What this PR does / why we need it**:
spec.SchedulerName should be spec.schedulerName in kube-scheduler help
```shell
--scheduler-name string                  Name of the scheduler, used to select which pods will be processed by this scheduler, based on pod's "spec.SchedulerName". (default "default-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 #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-10 05:31:17 -07:00
Lei Gong 4d155cf7a7 Fix some shadow declaration in cmd package
Signed-off-by: Lei Gong <lgong@alauda.io>
2018-04-09 16:58:25 +08:00
zhangxiaoyu-zidif a7771ef58b spec.SchedulerName should be spec.schedulerName in kube-scheduler help 2018-04-07 18:06:17 +08:00
Timothy St. Clair 3d0efc2e5a Update OWNERS labels for cluster-lifecycle and scheduling 2018-04-05 16:25:04 -05:00
Kubernetes Submit Queue 47a1aac931
Merge pull request #61388 from zjj2wry/kube-schedule-policy-configmap-namespace
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>.

default use kube-system namespace as policyConfigmapNamespace

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

**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 https://github.com/kubernetes/kubernetes/issues/61368

**Special notes for your reviewer**:
cc @kubernetes/sig-scheduling-pr-reviews

**Release note**:

```release-note
fix scheduling policy on ConfigMap breaks without the --policy-configmap-namespace flag set
```
2018-04-02 00:50:22 -07:00
zhengjiajin 677d03b114 default use kube-system namespace as policyConfigmapNamespace 2018-04-02 13:48:50 +08:00
Davanum Srinivas ba2778b17a Set leader-elect for kube-scheduler to true
Thanks to some great sleuthing by ikruglov!

kube-controller-manager defaults --leader-elect to true. We should
do the same for kube-scheduler. kube-scheduler used to have this
set to true, but it got lost during refactoring in:
efb2bb71cd
2018-03-30 10:52:01 -04:00
Davanum Srinivas 882a01ec87 Temporary fix for LeaderElect for kube-scheduler
kube-controller-manager defaults --leader-elect to true. We should
do the same for kube-scheduler. kube-scheduler used to have this
set to true, but it got lost during refactoring:

efb2bb71cd
2018-02-27 21:20:47 +00:00
hzxuzhonghu 398a0a9e66 update bazel 2018-02-22 16:43:13 +08:00
hzxuzhonghu 385a61e04f kube-scheduler make use of generic apiserver profiling 2018-02-22 16:43:12 +08:00
Kubernetes Submit Queue b3099bcf53
Merge pull request #58097 from steveperry-53/ipv6
Automatic merge from submit-queue (batch tested with PRs 59391, 58097, 60057, 60090). 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 IPv6 to command options.

**What this PR does / why we need it**:
This PR adds IPv6 information to the descriptions for several command options.

[Related PR in kubernetes/website](https://github.com/kubernetes/website/pull/6498)

**Release note**:

```release-note
NONE
```
2018-02-20 13:51:32 -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
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Davanum Srinivas 265e5ae085 Log the command line flags
With d7ddcca231, we lost the logging
of the flags. We should at least log what the command line flags
were used to start processes as those incredibly useful for trouble shooting.
2018-02-15 18:04:04 -05:00
steveperry-53 cc7cea74ae Merge branch 'master' into ipv6 2018-02-14 10:45:27 -08:00
ravisantoshgudimetla 34d35f1304 Scheduler is not able to read from config file if configmap is not present 2018-02-05 20:39:22 -05:00
steveperry-53 1a530d1884 Add IPv6 to ref page descriptions. 2018-02-01 19:29:54 +00:00
Kubernetes Submit Queue 6177b42e62
Merge pull request #58408 from deads2k/hyperkube-01-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

switch hyperkube to cobra

This makes use of cobra to layer the commands with a library that already supports composing commands.

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

```release-note
NONE
```
2018-01-26 08:23:01 -08:00
Kubernetes Submit Queue ab788d2312
Merge pull request #58302 from deads2k/controller-05-id
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>.

uniquify resource lock identities

Resource lock identities on the same host were not unique.  This keeps the hostname (that's valuable), but also adds a UUID so that you can start a process twice on the same host and not end up with two processes trying to lead.

@kubernetes/sig-api-machinery-bugs @liggitt @smarterclayton
2018-01-25 11:29:40 -08:00
David Eads e48847e6ce switch hyper to cobra 2018-01-24 11:02:19 -05:00
David Eads 25238441fd uniquify resource lock identities 2018-01-18 11:31:43 -05:00
David Eads 5d0847585b handle scheduler without exposed ports 2018-01-18 09:52:46 -05:00
David Eads d7ddcca231 low hanging fruit for using cobra commands 2018-01-17 13:43:43 -05:00
Jonathan Basseri 85c5862552 Fix scheduler refs in BUILD files.
Update references to moved scheduler code.
2018-01-05 15:05:01 -08:00
Jonathan Basseri 30b89d830b Move scheduler code out of plugin directory.
This moves plugin/pkg/scheduler to pkg/scheduler and
plugin/cmd/kube-scheduler to cmd/kube-scheduler.

Bulk of the work was done with gomvpkg, except for kube-scheduler main
package.
2018-01-05 15:05:01 -08:00