Commit Graph

369 Commits

Author SHA1 Message Date
zhouya0
4d3d722ebc Add missing kube build info metric 2020-04-01 17:04:45 +08:00
notpad
52ad3d95f7 Add test for algorithm provider and policy config file 2020-03-24 23:18:32 +08:00
gavinfish
1865a104a9 Remove kubescheduler.config.k8s.io/v1alpha1 2020-03-21 15:11:48 +08:00
Kubernetes Prow Robot
72102c04c7
Merge pull request #88728 from notpad/feature/scheduler_e2e_test
Add test for kube-scheduler command setup
2020-03-19 20:30:36 -07:00
notpad
16015a691c Add test for kube-scheduler command setup 2020-03-20 07:36:47 +08:00
Davanum Srinivas
1d057da2f7
Move k8s.io/apiserver/pkg/util/term to k8s.io/component-base/term
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-19 07:18:09 -04:00
Kubernetes Prow Robot
f899ad704a
Merge pull request #89069 from enj/enj/i/drop_password_file
Remove support for basic authentication
2020-03-18 22:24:20 -07:00
Mateusz Gozdek
dfe1f968ac
kube-apiserver: use SO_REUSEPORT when creating listener on Unix systems
So multiple instances of kube-apiserver can bind on the same address and
port, to provide seamless upgrades.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
2020-03-13 23:55:57 +01:00
Monis Khan
df292749c9
Remove support for basic authentication
This change removes support for basic authn in v1.19 via the
--basic-auth-file flag.  This functionality was deprecated in v1.16
in response to ATR-K8S-002: Non-constant time password comparison.

Similar functionality is available via the --token-auth-file flag
for development purposes.

Signed-off-by: Monis Khan <mok@vmware.com>
2020-03-11 20:55:47 -04:00
Mike Dame
1d7006c38d Add Extenders to scheduler v1alpha2 component config 2020-03-05 16:42:15 -05:00
Kubernetes Prow Robot
e9d502e4fc
Merge pull request #88663 from deads2k/enable-profiling-by-default
update kube-controller-manager and kube-scheduler to match kube-apiserver defaults
2020-03-02 07:24:43 -08:00
yuzhiquanlong
3eec87cd91 update WithPlugin comment, in case remove function 2020-02-29 19:53:04 +08:00
David Eads
aa07992a44 update kube-controller-manager and kube-scheduler to match kube-apiserver defaults 2020-02-28 11:18:00 -05:00
Aldo Culquicondor
07c4982245 Add unit and integration tests for multiple profiles support
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-26 10:14:03 -05:00
Kubernetes Prow Robot
5704bff0de
Merge pull request #84913 from serathius/metrics-scheduler
Add show-hidden-metrics-for-version to scheduler
2020-02-25 21:02:26 -08:00
Aldo Culquicondor
c048858471 Support multiple scheduling profiles in a single scheduler
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-25 11:31:20 -05:00
Aldo Culquicondor
9e71741d06 Add Profiles to kubescheduler.config.k8s.io/v1alpha2
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-24 09:45:46 -05:00
Marek Siarkowicz
8b825d1511 Add show-hidden-metrics-for-version to scheduler 2020-02-14 10:14:31 +01:00
Aldo Culquicondor
99bda6fac0 Remove HardPodAffinityWeight from v1alpha2
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-13 11:59:56 -05:00
skilxn-go
f5b7e3cca3 Rename PostFilter plugin to PreScore 2020-02-12 23:25:08 +08:00
Aldo Culquicondor
2ffb13e822 Do lenient decoding only for kubescheduler config v1alpha1
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-07 15:41:00 -05:00
Kubernetes Prow Robot
5ced53c0c4
Merge pull request #87628 from alculquicondor/cc-v1alpha2
Add kubescheduler.config.k8s.io/v1alpha2
2020-01-30 16:59:33 -08:00
Aldo Culquicondor
3d83ef2e8e Autogenerated and build files for kubescheduler.config.k8s.io/v1alpha2
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-29 17:18:48 -05:00
Aldo Culquicondor
11c4bcd9dd Copy kubescheduler.config.k8s.io/v1alpha1 files onto v1alpha2
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-29 17:18:41 -05:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
Kubernetes Prow Robot
719b8aa5f3
Merge pull request #86709 from mwmix/scheduler_unit_tests
Adding unit tests for kube-scheduler Config Complete() method.
2020-01-16 13:14:31 -08:00
Kubernetes Prow Robot
28b8cfb473
Merge pull request #87005 from yuxiaobo96/k8s-unuseful
Add a comment for function WithPlugin
2020-01-10 12:24:36 -08:00
yuxiaobo
d2cfd4b82f apply review advice again
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2020-01-10 16:47:30 +08:00
Kubernetes Prow Robot
f4e6ff84b3
Merge pull request #86529 from hase1128/kube-scheduler-reference
Add simple reference to synopsis of kube-scheduler
2020-01-09 13:29:06 -08:00
Matthew Mix
57f2d7ad6f Adding unit tests for kube-scheduler Config Complete() method. 2020-01-07 18:52:21 -05:00
Abdullah Gharaibeh
d31dcecd20 cleanup unused scheduler functions/files 2020-01-03 19:09:14 -05:00
Abdullah Gharaibeh
a6b7b0d95e Define algorithm providers in terms of plugins. 2019-12-31 15:28:09 -05:00
Jin Hase
c715aacdc2 Add simple reference to synopsis of kube-scheduler 2019-12-20 20:55:35 +09:00
Igor Zibarev
6350095d3c scheduler: make algorithm source an option
Changes scheduler.New so that algorithm source is moved from the
parameter to an option. The default algorithm source is source with the
DefaultProvider.
2019-11-13 10:22:29 +03:00
Abdullah Gharaibeh
9fb380ceff set default percentageOfNodesToScore in kube-scheduler back to 0 (maning adaptive) 2019-11-09 06:34:06 -05:00
Kubernetes Prow Robot
e6287b05c0
Merge pull request #84812 from alculquicondor/fix/write-config
Write scheduler configuration from config file
2019-11-06 12:20:58 -08:00
Alex Wang
e85ebccb57 enable profiling by default in the scheduler 2019-11-06 15:25:35 +08:00
Kubernetes Prow Robot
6f08d42dec
Merge pull request #84815 from alculquicondor/fix/config-validation
Validate scheduler configuration from config file
2019-11-05 22:19:18 -08:00
Mike Dame
9e2591f867 Change scheduler ComponentConfig fields to nilable
As part of graduating the scheduler's component config to beta, we require configurable fields to be nilable pointers (see https://github.com/kubernetes/kubernetes/issues/78109). This enables the ability to distinguish between default and unset values. We are only applying this change to external types, and reacting in our defaulting logic. This also reverts existing internal component config fields which were pointers to be non-pointers, for consistency.
2019-11-05 17:06:06 -05:00
Aldo Culquicondor
37efa751c7 Validate scheduler configuration from config file
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-11-05 15:12:46 -05:00
Aldo Culquicondor
49ea5afaf7 Write scheduler configuration from config file
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-11-05 14:35:02 -05:00
obitech
b15aba547a Add lenient decoding path for v1alpha1 kube-scheduler config
This implements a lenient path for decoding a kube-scheduler config file.
The config file gets decoded with a strict serializer first, if that fails a lenient
CodecFactory that has just v1alpha1 registered into it is used for decoding. The lenient
path is to be dropped when support for v1alpha1 is dropped.

For more information on the discussion see #82924 and the linked PRs.
2019-10-31 13:43:52 +01:00
Kubernetes Prow Robot
486e2380bd
Merge pull request #83692 from yastij/fix-events-scheduler
add a fallback for kube-scheduler  when events.k8s.io is disabled
2019-10-28 14:08:43 -07:00
Yassine TIJANI
f970b34137 add a fallback for kube-scheduler when events.k8s.io is disabled
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-10-28 19:09:47 +01:00
wojtekt
ce499ac286 Migrate components to EndpointsLeases leader election lock 2019-10-28 09:09:03 +01:00
Cong Liu
571cea0519 Convert NodeLabelPresence custom predicate to filter plugin. 2019-10-25 19:31:17 -04:00
draveness
47a6c5b693 feat(scheduler): use context in the scheduler package
+ Use context instead of stopCh
+ Add context to the scheduling framework interface
2019-10-17 09:03:55 +08:00
Shintaro Murakami
a86634bc17 Support dynamically set log level for kube-scheduler 2019-10-15 01:32:41 +09:00
Ahmad Diaa
4448a1cea9 move factory package to scheduler 2019-10-12 23:03:07 +02:00
draveness
ee4dec65b5 feat(scheduler): expose SharedInformerFactory to the framework handle 2019-10-11 10:23:21 +08:00
Abdullah Gharaibeh
456df97745 made scheduler cache and volume binder available when instantiating factories for default plugins 2019-10-10 16:21:29 -04:00
draveness
9646afb1f5 feat: add pod initial/max backoff duration to config API 2019-10-09 19:48:28 +08:00
Kubernetes Prow Robot
6dde8daa76
Merge pull request #83030 from obitech/kube_scheduler_strict_serializer
Enable strict serializer in kube-scheduler
2019-10-04 10:22:04 -07:00
Abdullah Gharaibeh
30e7016ccf Refactor scheduler.New so that all framework-related parameters are passed as options 2019-10-03 11:39:59 -04:00
Kubernetes Prow Robot
74d2822662
Merge pull request #72535 from tallclair/content-type
Always set content-type & nosniff
2019-09-27 18:43:39 -07:00
obitech
6acef2b94c Enable strict serializer with codec factory
- Enabling strict serializer will throw errors on e.g. duplicate
  or unknown fields in YAML configs
- Add test cases for duplicate and unknown fields
2019-09-26 17:41:07 +02:00
Mark Janssen
1a1b7001d6 Fix staticcheck failures for scheduler packages
Errors from staticcheck:
cmd/kube-scheduler/app/server.go:297:27: prometheus.Handler is deprecated: Please note the issues described in the doc comment of InstrumentHandler. You might want to consider using promhttp.Handler instead.  (SA1019)
pkg/apis/scheduling/v1alpha1/defaults.go:27:6: func addDefaultingFuncs is unused (U1000)
pkg/apis/scheduling/v1beta1/defaults.go:27:6: func addDefaultingFuncs is unused (U1000)
test/e2e/scheduling/predicates.go:757:6: func verifyReplicasResult is unused (U1000)
test/e2e/scheduling/predicates.go:765:6: func getPodsByLabels is unused (U1000)
test/e2e/scheduling/predicates.go:772:6: func runAndKeepPodWithLabelAndGetNodeName is unused (U1000)
test/e2e/scheduling/limit_range.go:172:3: this value of pod is never used (SA4006)
test/e2e/scheduling/limit_range.go:177:3: this value of pod is never used (SA4006)
test/e2e/scheduling/limit_range.go:196:3: this value of pod is never used (SA4006)
test/e2e/scheduling/limit_range.go:201:3: this value of pod is never used (SA4006)
test/e2e/scheduling/limit_range.go:240:3: this value of pod is never used (SA4006)
test/e2e/scheduling/taints.go:428:13: this value of err is never used (SA4006)
test/e2e/scheduling/ubernetes_lite.go:219:2: this value of pods is never used (SA4006)
test/integration/scheduler/extender_test.go:78:4: this value of resp is never used (SA4006)
test/integration/volumescheduling/volume_binding_test.go:529:15: this result of append is never used, except maybe in other appends (SA4010)
test/integration/volumescheduling/volume_binding_test.go:538:15: this result of append is never used, except maybe in other appends (SA4010)
2019-09-23 22:52:57 +02:00
Han Kang
866ea74326 remove pkg/version and some of redundant copies of it
Change-Id: Ia58367c1b1274bfb49c8a4784051463abaf795de
2019-09-16 16:24:35 -07:00
Abdullah Gharaibeh
3174d9c847 Added a noop plugin to make sure we have the dependencies worked out for the default registry of the scheduler framework. 2019-09-13 13:36:35 -04:00
Tim Allclair
ef6cba0b36 Always set content-type & nosniff 2019-09-11 15:01:43 -07:00
Zhonghu Xu
fb3274759f Remove duplicate logging 2019-09-11 14:58:04 +08:00
Kubernetes Prow Robot
6e684875ab
Merge pull request #81954 from SataQiu/fix-schedule-20190826
schedule code clean: using string prefix instead of MarkDeprecated
2019-08-28 08:55:59 -07:00
Kubernetes Prow Robot
a927ed454c
Merge pull request #81576 from logicalhan/scheduler-migration
migrate scheduler metrics to stability framework
2019-08-28 08:55:12 -07:00
Han Kang
8da448dbe3 migrate scheduler metrics endpoint to metrics stability framework 2019-08-28 03:40:43 -07:00
David Eads
f589c1213c add cache-control headers to kube-apiserver 2019-08-26 13:00:31 -04:00
SataQiu
cb8183c680 schedule code clean: using string prefix instead of MarkDeprecated 2019-08-27 00:03:29 +08:00
Kubernetes Prow Robot
8dea3310e5
Merge pull request #81376 from logicalhan/health-checks
rename healthz methodNames to be more consistent w/ present day usages
2019-08-22 03:48:32 -07:00
Han Kang
2e23788fda rename healthz methodNames to be more consistent w/ present day usages 2019-08-13 12:52:30 -07:00
ravisantoshgudimetla
3a1354d590 Autogenerated files 2019-08-09 15:23:43 -04:00
ravisantoshgudimetla
e2b29cd508 Scheduler should terminate when it looses leader lock 2019-08-09 15:23:28 -04:00
Kubernetes Prow Robot
aa6a077cfd
Merge pull request #80681 from ricky1993/customize_resource_name_and_namespace
add options for name and namespace of leaderelection object
2019-08-07 01:36:51 -07:00
chenyixiang
41a435a812 migrate scheduler options to resourceName & resourceNamespace
Change-Id: I743eda488320c97c123b49018d7efcc57525b152
2019-08-03 11:42:47 +08:00
Clayton Coleman
33521b41d4
Disable gzip compression in core control plane components
On local networks (such as the typical connection path between
control plane components) gzip compression increases CPU use and
end to end p99 latency rather than decreasing it. Disable compression
within the control plane components like a 1.15 cluster would be
configured.
2019-08-02 16:18:15 -04:00
Kubernetes Prow Robot
619a3985d0
Merge pull request #80206 from tedyu/sched-svr-dup
Remove duplicate requestInfoResolver
2019-07-16 15:24:43 -07:00
Ted Yu
a3f06c7e23 Remove duplicate requestInfoResolver 2019-07-16 10:53:07 -07:00
Kubernetes Prow Robot
c30f024864
Merge pull request #78162 from hex108/registry
Add support for writing out of tree custom scheduler plugins
2019-07-15 23:29:24 -07:00
Yassine TIJANI
08522f8e5a move scheduler to use v1beta1.events
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-07-12 11:39:01 +02:00
Jun Gong
5828223e75 Rename PluginOption to Option 2019-07-11 17:39:48 +08:00
Kubernetes Prow Robot
dd8a000a77
Merge pull request #79493 from odinuge/kube-cmd-double-print
Remove duplicate error messages from cli commands
2019-06-28 13:57:41 -07:00
Odin Ugedal
7caf51daa4
Remove duplicate error messages from cli commands
Since we never use the cobras "SilenceErrors" or "SilenceUsage",
a command executed with "cmd.Execute()" will never return an error
without printing it.

The current behavior results in all error messages being printed twice:

Example:

$ kubectl abc
Error: unknown command "abc" for "kubectl"
Run 'kubectl --help' for usage.
unknown command "abc" for "kubectl"

This applies to all cli commands using Cobra. To verify, follow the code
path of the Execute function:

https://github.com/spf13/cobra/blob/c439c4fa0937/command.go#L793
Signed-off-by: Odin Ugedal <odin@ugedal.com>
2019-06-27 21:55:14 +02:00
Fabio Bertinatto
00b0ab86af Update scheduler to use volume limits from CSINode 2019-06-25 16:30:54 +02:00
Kubernetes Prow Robot
415323ca9b
Merge pull request #78340 from sftim/20190524_docs_insecure_serving_fix
Fix typo in kube-scheduler --port option help
2019-06-25 07:06:39 -07:00
Jun Gong
107e989454 Use WithOption to implment scheduler register 2019-06-25 17:03:21 +08:00
Andy Goldstein
9bba2c93ec
Fix max port value to 65535
Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
2019-06-24 15:13:27 -04:00
Jun Gong
e9793c8bdb Pass registry parameter to scheduler instead of global singleton 2019-06-24 11:29:47 +08:00
Jun Gong
ea8e1e01c5 Add support for writing out of tree custom scheduler plugins 2019-06-24 10:43:47 +08:00
Tim Bannister
82fd3e2fa7
Fix typo
Write "HTTP" (and not "HTTPS") to describe plain HTTP.
2019-05-24 23:55:55 +01:00
JieJhih Jhang
2cd5fc54a1 add scheduling framework configuration
update bazel build

fix get plugin config method

initialize only needed plugins

fix unit test

fix import duplicate package

update bazel

add docstrings

add weight field to plugin

add plugin to v1alpha1

add plugins at appropriate extension points

remove todo statement

fix import package file path

set plugin json schema

add plugin unit test to option

initial plugin in test integration

initialize only needed plugins

update bazel

rename func

change plugins needed logic

remove v1 alias

change the comment

fix alias shorter

remove blank line

change docstrings

fix map bool to struct

add some docstrings

add unreserve plugin

fix docstrings

move variable inside the for loop

make if else statement cleaner

remove plugin config from reserve plugin unit test

add plugin config and reduce unnecessary options for unit test

update bazel

fix race condition

fix permit plugin integration

change plugins to be pointer

change weight to int32

fix package alias

initial queue sort plugin

rename unreserve plugin

redesign plugin struct

update docstrings

check queue sort plugin amount

fix error message

fix condition

change plugin struct

add disabled plugin for unit test

fix docstrings

handle nil plugin set
2019-05-18 06:30:28 +08:00
Yecheng Fu
214ea1a9d3 Update scheduler to use new volume scheduling library
To fix scheme issue, use k8s.io/client-go/kubernetes/scheme instead of
legacyscheme.
2019-05-02 14:57:47 +08:00
Bobby (Babak) Salamat
83828bcb2d autogenerated files 2019-04-29 16:40:56 -07:00
Bobby (Babak) Salamat
77824f5135 Change scheduler constructors to receive a plugin registry. 2019-04-29 16:40:56 -07:00
Shintaro Murakami
28b3cff13c Remove redundant wait for cache sync 2019-04-13 08:12:33 +09:00
leigh capili
47e52d2981 Refactor loops over SupportedMediaTypes() where mediaType is used to match a single SerializerInfo{}
We have an existing helper function for this:  runtime.SerializerInfoForMediaType()

This is common prep-work for encoding runtime.Objects into JSON/YAML for transmission over the wire or writing to ComponentConfigs.
2019-04-04 19:01:01 -06:00
Kubernetes Prow Robot
e9c42a15f7
Merge pull request #73672 from WanLinghao/failure_domain_remove
Remove dead code about failure-domains option in kube-scheduler
2019-03-30 18:22:33 -07:00
WanLinghao
f510f49955 Remove dead code about failure-domains option in kube-scheduler 2019-03-18 14:25:04 +08:00
liurui
0a1227c2b1 fix typo 2019-03-11 11:19:39 +08:00
Xiang Dai
36065c6dd7 delete all duplicate empty blanks
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-23 10:28:04 +08:00
Marek Counts
160ed26c20 autogen files to support new project structure. 2019-02-15 10:29:31 -05:00
Marek Counts
7744f90830 Moved flag and globalflag
Moved all flag code from `staging/src/k8s.io/apiserver/pkg/util/[flag|globalflag]` to `component-base/cli/[flag|globalflag]` except for the term function because of unwanted dependencies.
2019-02-15 10:28:13 -05:00
PingWang
d8e3d11c8b Fix function comment to consistent with its name
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2019-02-11 10:51:35 +08:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Kubernetes Prow Robot
d3a2566371
Merge pull request #73109 from palash25/verlog
Add version logging to kube-scheduler
2019-01-25 15:28:08 -08:00
Kubernetes Prow Robot
d027ecfa97
Merge pull request #70778 from wongma7/lease
Add Lease implementation to leaderelection package
2019-01-24 08:45:25 -08:00
Palash Nigam
e0bbce2a8a
Add version logging to kube-scheduler
Related to: #27744
2019-01-24 10:58:41 +05:30
Matthew Wong
410175851c Add Lease implementation to leaderelection package 2019-01-23 10:50:53 -05:00
Kubernetes Prow Robot
26d58d37a7
Merge pull request #72970 from sttts/sttts-wait-for-http-server-finished-shutdown
apiserver: sync with http server shutdown to flush existing connections
2019-01-18 03:06:36 -08:00
Dr. Stefan Schimanski
5b47f99164 apiserver: sync with https server shutdown to flush existing connections 2019-01-18 10:56:38 +01:00
Marek Counts
1739e343a8 autogen files
all the autogen files that got updated due to the changes to move logs.
2019-01-17 09:16:36 -05:00
Marek Counts
ba81a5409a move logs into component-base
all the code changes to move move /apiserver/pkg/util/logs into /component-base/logs
2019-01-17 09:16:21 -05:00
Kubernetes Prow Robot
2c8b571d57
Merge pull request #71875 from wgliang/cleanup/remove-newfrom-functions
Move users of `factory.NewConfigFactory` to `scheduler.New`
2019-01-09 13:55:51 -08:00
Guoliang Wang
3c24c99b08 Move users of factory.NewConfigFactory to scheduler.New 2019-01-09 06:40:30 +08:00
Kubernetes Prow Robot
cc67ccfd7f
Merge pull request #71731 from cheftako/leaseMetric
Add gauge metric for master of leader election.
2019-01-08 08:57:53 -08:00
Lucas Käldström
1edd2723f8
autogenerated files 2019-01-06 15:48:53 +02:00
Lucas Käldström
0140c82c16
Updated references from k8s.io/{apiserver,apimachinery} to the new k8s.io/component-base repo. Co-authored-by @Klaven 2019-01-06 14:01:26 +02:00
Kubernetes Prow Robot
ad579a58da
Merge pull request #72011 from ping035627/k8s-181213
Add Broadcaster.StartLogging for scheduler
2019-01-03 20:21:43 -08:00
Jordan Liggitt
73dcfe12da Stop checking VolumeScheduling feature gate 2018-12-27 17:45:45 -05:00
Walter Fender
f192657380 Add gauge metric for master of leader election.
Fixes #71730
0 indicates standby, 1 indicates master, label indicates which lease.
Tweaked name and documentation
Factored in Mike Danese feedback.
Removed dependency on prometheus from client-go using adapter.
Centralized adapter import.
Fixed godeps
Fixed boilerplate.
Put in fixes for caesarxuchao
2018-12-27 09:40:33 -08:00
PingWang
ba01a6e960 Add Broadcaster.StartLogging
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

modify StartLogging to V(6)

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2018-12-21 08:55:48 +08:00
Guoliang Wang
6515c4e09b Set percentage of nodes scored in each cycle dynamically based on the cluster size 2018-12-20 11:20:00 +08:00
wangqingcan
1081e919e3 Eclass Task 1: clean up old equiv class code
Co-authored-by: Harry Zhang <resouer@gmail.com>
Co-authored-by: Wang Qingcan <wangqingcan@baidu.com>
2018-12-17 17:05:49 -08:00
Jordan Liggitt
416e114215 Allow kube-scheduler to tolerate cluster auth config lookup failure 2018-12-05 14:13:47 -05:00
k8s-ci-robot
79e5cb2cb7
Merge pull request #71302 from liggitt/verify-unit-test-feature-gates
Split mutable and read-only access to feature gates, limit tests to readonly access
2018-11-29 21:45:12 -08:00
k8s-ci-robot
8b11fda27b
Merge pull request #67931 from tanshanshan/littleprint
make error info clearly
2018-11-28 21:44:28 -08:00
Jordan Liggitt
d440ecdd3b Update non-test code to use DefaultMutableFeatureGate 2018-11-21 11:51:33 -05:00
Bobby (Babak) Salamat
34b4a5bbee Add watchdog for leader election logic getting wedged 2018-11-15 11:02:14 -08:00
stewart-yu
529dbd27ac auto-generated file 2018-11-11 17:19:38 +08:00
stewart-yu
a77652e9ab kube-scheduler: output flags in logical sections 2018-11-11 17:19:38 +08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Dr. Stefan Schimanski
1588af4031 kube-scheduler: add secure serving and authn/z integration tests 2018-11-08 16:43:59 +01:00
Dr. Stefan Schimanski
0ba66130b3 kube-scheduler: split out cmd Run func 2018-11-08 16:43:59 +01:00
Dr. Stefan Schimanski
d91feb6d18 kube-scheduler: move stopCh creation out of scheduler factory code
Enforces clean ownership of the channel.
2018-11-08 16:43:59 +01:00
tanshanshan
cb95edafe8 kube-scheduler: enable secure ports 10259 2018-11-08 16:43:59 +01:00
Jordan Liggitt
33a866c470 Remove temporary workaround for scheduler alpha config-loading 2018-10-20 01:07:28 -04:00
k8s-ci-robot
cf3a930938
Merge pull request #69607 from mikedanese/audctx
tokenreview: add APIAudiences config to generic API server and augment context
2018-10-15 19:03:43 -07:00
k8s-ci-robot
d54e0fc0bc
Merge pull request #69670 from atlassian/simplify-rand-seed
Simplify rand seeding
2018-10-15 13:53:01 -07:00
Mikhail Mazurskiy
3a243090a5
Simplify random seed initialization
There is no need to set the time zone as the result does not
depend on it
2018-10-11 21:01:15 +11:00
wangqingcan
608911d5ac add test for new constructor 2018-10-10 17:15:10 +08:00
wangqingcan
a74fd15e62 create a new scheduler constructor 2018-10-10 17:10:10 +08:00
Mike Danese
21fd8f2041 tokenreview: add APIAudiences config to generic API server and augment context 2018-10-09 22:47:10 -07:00
k8s-ci-robot
3c43f089b2
Merge pull request #69155 from mooncak/fix_duplicate_words
remove duplicate words in files
2018-09-27 12:21:46 -07:00
mooncake
9c561d0c68 remove duplicate words in files 2018-09-27 22:58:47 +08:00
k8s-ci-robot
2662ca309d
Merge pull request #69037 from shubheksha/fix/68964-simplify-run-method-kube-scheduler-server
Simplify kube-scheduler's run() method
2018-09-27 07:18:11 -07:00
k8s-ci-robot
823530d4db
Merge pull request #68917 from zhangmingld/fixwordserr
Fix some typo err
2018-09-26 22:59:32 -07:00
Shubheksha Jalan
564ee22123 simplify run method of kube-scheduler cmd 2018-09-26 00:39:37 +05:30
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