Commit Graph

180 Commits

Author SHA1 Message Date
Clayton Coleman
264496cc41
scheduler: Implement resource metrics at /metrics/resources
Implement pod resource metrics as described in KEP 1916. The new
`/metrics/resources` endpoint is exposed on the active scheduler
and reports kube_pod_resources* metrics that present the effective
requests and limits for all resources on the pods as calculated by
the scheduler and kubelet. This allows administrators using the
system to quickly perform resource consumption, reservation, and
pending utilization calculations when those metrics are read.
Because metrics calculation is on-demand, there is no additional
resource consumption incurred by the scheduler unless the endpoint
is scraped.
2020-11-12 12:37:38 -05:00
Lukasz Szaszkiewicz
057986e32c stops puting a stacktrace of aborted requests in the logs
Aborted requests are the ones that were disrupted with http.ErrAbortHandler.
For example, the timeout handler will panic with http.ErrAbortHandler when a response to the client has been already sent
and the timeout elapsed.

Additionally, a new metric requestAbortsTotal was defined to count aborted requests. The new metric allows for aggregation for each group, version, verb, resource, subresource and scope.
2020-11-09 09:23:40 +01:00
Harsh Singh
1763688d71 Added config parameter for CPU threads 2020-10-29 12:16:10 +05:30
Arghya Sadhu
c62f0dd165 removing deprecated scheduler metrics 2020-09-22 21:04:15 +05:30
Wei Huang
d8def59871
Initialize scheduler's podInformer in sharedInformerFactory
Scheduler's specific podInfomer is now initialized inside the sahredInformerFactory.
2020-09-08 12:57:17 -07:00
zhouya0
3a237dd367 Scheduler auth stop using legacy scheme 2020-08-16 18:49:15 +08:00
Wei Huang
4b26ef2217
Remove DisablePreemption field from SchedulerConfig v1beta1
DisablePreemption field can be removed as it can be deduced from PostFilterPlugins.
2020-07-08 09:58:42 -07:00
Kubernetes Prow Robot
ad634590f8
Merge pull request #92082 from chelseychen/event-fallback2
Migrate kube-scheduler to fallback for events API built into the library
2020-06-23 01:23:40 -07:00
Chelsey Chen
3f95ddb714 Migrate kube-scheduler to use common fallback 2020-06-22 10:02:54 -04:00
Ali Farah
a22e115a0e Split scheduler framework implementation into new runtime package 2020-06-22 00:23:43 +10:00
Yecheng Fu
1ff09c0934 Remove BindTimeoutSeconds from KubeSchedulerConfiguration 2020-06-03 09:54:06 +08:00
Kubernetes Prow Robot
774c9a6db6
Merge pull request #91349 from neolit123/1.19-fail-on-unrecognized-args
cmd/*: fail on unrecognized flags/arguments for component CLI
2020-05-30 00:27:53 -07:00
Monis Khan
fc4f91f10b cmd/*: fail on unrecognized flags/arguments for component CLI
In case a malformed flag is passed to k8s components
such as "–foo", where "–" is not an ASCII dash character,
the components currently silently ignore the flag
and treat it as a positional argument.

Make k8s components/commands exit with an error if a positional argument
that is not empty is found. Include a custom error message for all
components except kubeadm, as cobra.NoArgs is used in a lot of
places already (can be fixed in a followup).

The kubelet already handles this properly - e.g.:
'unknown command: "–foo"'

This change affects:
- cloud-controller-manager
- kube-apiserver
- kube-controller-manager
- kube-proxy
- kubeadm {alpha|config|token|version}
- kubemark

Signed-off-by: Monis Khan <mok@vmware.com>
Signed-off-by: Lubomir I. Ivanov <lubomirivanov@vmware.com>
2020-05-28 22:06:01 +03:00
Hsiny
9c7be05b60 fix,404 link in kube-scheduler command usage description 2020-05-25 23:07:00 +08:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
cici37
7f4d19167e Move pkg/util/configz to k8s.io/component-base 2020-04-29 12:17:25 -07:00
cici37
15c844031f Remove CCM dependency pkg/util/flag 2020-04-22 10:06:11 -07:00
Dharma Bellamkonda
49bcf18cc5 Improve scheduler CLI description 2020-04-15 14:14:45 -06: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
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
yuzhiquanlong
3eec87cd91 update WithPlugin comment, in case remove function 2020-02-29 19:53:04 +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
Aldo Culquicondor
99bda6fac0 Remove HardPodAffinityWeight from v1alpha2
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-13 11:59:56 -05: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
Abdullah Gharaibeh
d31dcecd20 cleanup unused scheduler functions/files 2020-01-03 19:09:14 -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
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
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
49ea5afaf7 Write scheduler configuration from config file
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-11-05 14:35:02 -05: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
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
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
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
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
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
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
e2b29cd508 Scheduler should terminate when it looses leader lock 2019-08-09 15:23:28 -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
Fabio Bertinatto
00b0ab86af Update scheduler to use volume limits from CSINode 2019-06-25 16:30:54 +02:00
Jun Gong
107e989454 Use WithOption to implment scheduler register 2019-06-25 17:03:21 +08: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
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
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
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
Palash Nigam
e0bbce2a8a
Add version logging to kube-scheduler
Related to: #27744
2019-01-24 10:58:41 +05:30
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
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
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
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
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
Bobby (Babak) Salamat
34b4a5bbee Add watchdog for leader election logic getting wedged 2018-11-15 11:02:14 -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
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
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
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
Shubheksha Jalan
564ee22123 simplify run method of kube-scheduler cmd 2018-09-26 00:39:37 +05:30
Michelle Au
e124159990 Add scheduler option for bind timeout 2018-09-04 17:25:23 -07: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
tizhou86
e0a6d6bd32 Add function comment to fix golint error in cmd/kube-scheduler/app. 2018-08-28 11:15:50 +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
xushiwei 00425595
fed8572745 use apps/v1 version for scheduler 2018-07-26 17:37:29 +08: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