Commit Graph

196 Commits

Author SHA1 Message Date
Wei Huang
72863f65d6
Graduate PodSchedulingReadiness to beta 2023-02-17 18:45:20 -08:00
Lucas Severo Alves
6b34fafdaf
Add ctx logging involved in KS startup (#115588)
* ctx logging involved in startup

as per https://github.com/kubernetes/kubernetes/pull/111155#pullrequestreview-1283257121

* use klog.Background().Error in flag handling

* revert scheduler_perf changes

* refence issue in code comment

* enable ctx logcheck for cmd/kube-scheduler
2023-02-13 09:19:29 -08:00
Kubernetes Prow Robot
a94a35293b
Merge pull request #114490 from MadhavJivrajani/update-contention-profiling-docs
*: Make docs more accurate for the contention-profiling flag
2023-01-29 17:20:49 -08:00
Daniel Vega-Myhre
41817b1888 optionally ignore preferred terms of existing pods unless incoming pod
has inter-pod affinities
2023-01-13 23:15:53 +00:00
Madhav Jivrajani
f236ab24df *: Make docs more accurate for the contention-profiling flag
The --contention-profiling flag enables block profiling by calling
SetBlockProfileRate(). It, however does not call SetMutexProfileFraction
which enables mutex profiling.

Mutex profiling gives us information about lock contention whereas
block profiling on the other hand gives us information on gorotuines
being blocked on sync primitives.

Updating the docs to "block profiling" in order to make it more accurate.
Eventhough a block profile may reflect contention points on locks to some
extent, it also talks about other sources where goroutines may be blocked.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2022-12-14 17:34:47 +05:30
Wei Huang
0b27f25252
PreEnqueue implementation
- Add PreEnqueuePlugin to Scheduler Framework
- Implement PreEnqueuePlugin in scheduler queue
- Implementation of SchedulingGates plugin
- Metrics
2022-11-07 14:02:58 -08:00
Wojciech Tyczyński
3786cfdf85 Clean shutdown of serving integration test 2022-11-02 21:08:43 +01:00
Yuan Chen
7297f48f12 Add profile level percentageOfNodesToScore
Fix conversion errors

Changed the order

update

update

fix manaul coversions

keep the global parameter for backward compatibility

Address Wei's comments

Fix an error

Fix issues

Add unit tests for validation

Fix a comment

Address comments

Update comments

fix verifiation errors

Add tests for scheme_test.go

Convert percentageOfNodesToScore to pointer

Fix errors

Resolve conflicts

Fix testing errors

Address Wei's comments

Revert IntPtr to Int changes

Address comments

Not overrite percentageOfNodesToScore

Fix a bug

Fix a bug

change errs to err

Fix a nit

Remove duplication

Address comments

Fix lint warning

Fix an issue

Update comments

Clean up

Address comments

Revert changes to defaults

fix unit test error

Update

Fix tests

Use default PluginConfigs
2022-10-14 13:01:06 -07:00
Kubernetes Prow Robot
05f17ee5d6
Merge pull request #111076 from claudiubelu/unittests-6
unittests: Fixes cmd unit tests for Windows
2022-09-16 07:39:27 -07:00
kerthcet
700065a18d Add deprecation warning of removing scheduler CC v1beta3
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-09-07 10:09:27 +08:00
kerthcet
532d1df7ca Modify release version of removing scheduler CC v1beta2
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-09-06 14:15:55 +08:00
Claudiu Belu
d192029e6a unittests: Fixes cmd unit tests for Windows
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- filepath.IsAbs does not consider "/" or "\" as absolute paths, even
  though files can be addressed as such.
- paths not properly joined (filepath.Join should be used).
- files not closed, which means that they cannot be removed / renamed.
- some assertions fail due to slashes / backslashes not matching.
- backslashes need to be escaped in yaml files, or put between ''
instead of "".
2022-08-26 16:03:13 +03:00
Davanum Srinivas
8bec318b5d
Switch klog call to use structured logging
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-08-04 10:54:37 -04:00
Kubernetes Prow Robot
96439a0c3c
Merge pull request #111547 from kerthcet/feat/mark-cc-v1beta2-deprecated
Deprecate kubescheduler ComponentConfig v1beta2
2022-08-02 12:48:06 -07:00
kerthcet
c8fbd78c16 Deprecate kubescheduler ComponentConfig v1beta2
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-08-02 22:11:11 +08:00
Kubernetes Prow Robot
442548a064
Merge pull request #110534 from kerthcet/feat/ga-component-config
Graduate component config to stable in kube-scheduler
2022-07-29 09:59:11 -07:00
kerthcet
02f77a1b84 Feat: ga component config in kube-scheduler
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-07-29 08:47:48 +08:00
Dave Chen
79cac48b30 No need to assert an error when the error is not nil
Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-25 12:26:35 +08:00
Patrick Ohly
4c6338ac0f logs: replace config methods with functions
API types are only supposed to have methods related to serialization.
2022-06-17 20:22:13 +02:00
Kubernetes Prow Robot
d60df5ba04
Merge pull request #108159 from pohly/logcheck
logcheck update and golangci-lint integration
2022-03-24 18:37:50 -07:00
Patrick Ohly
0f4d0660a7 kube-scheduler: finish conversion to structured logging
Thanks to support for multi-line string values we can now also convert
these remaining klog.Info calls without making the output unreadable
in text format.

The debug log messages intentionally don't get changed to ensure that
developers looking for it still find it.

The output now looks like this:

I0322 11:44:46.715093  458409 configfile.go:96] "Using component config" config=<
	apiVersion: kubescheduler.config.k8s.io/v1beta2
	clientConnection:
	  acceptContentTypes: ""
	  burst: 100
	  contentType: application/vnd.kubernetes.protobuf
	  kubeconfig: /var/run/kubernetes/scheduler.kubeconfig
	  qps: 50
	enableContentionProfiling: true
 ...
	  schedulerName: default-scheduler
 >

I0322 11:45:08.695649  458409 comparer.go:42] "Cache comparer started"
I0322 11:45:08.695718  458409 comparer.go:67] "Cache comparer finished"
I0322 11:45:08.695820  458409 dumper.go:52] "Dump of cached NodeInfo" nodes=<
	Node name: 127.0.0.1
	Deleted: false
	Requested Resources: &{MilliCPU:0 Memory:0 EphemeralStorage:0 AllowedPodNumber:0 ScalarResources:map[]}
	Allocatable Resources:&{MilliCPU:36000 Memory:67019448320 EphemeralStorage:181555660500 AllowedPodNumber:110 ScalarResources:map[hugepages-1Gi:0 hugepages-2Mi:0]}
	Scheduled Pods(number: 0):
 >
I0322 11:45:08.695873  458409 dumper.go:62] "Dump of scheduling queue" pods=<
	name: coredns-6874cd75d4-fv6hv, namespace: kube-system, uid: f1df106f-7fd9-460d-8403-333df61b2751, phase: Pending, nominated node:
 >
2022-03-24 11:13:50 +01:00
Alex Wang
8a5df1302a rename unschedulableQ to unschedulablePods
Signed-off-by: Alex Wang <wangqingcan1990@gmail.com>
2022-03-24 17:38:49 +08:00
Alex Wang
e772202e95 set PodMaxUnschedulableQDuration as 5 min 2022-03-17 15:37:34 +08:00
Alex Wang
87549203e9 add deprecated flag for flush pods to activeq interval 2022-02-16 11:05:52 +08:00
ahrtr
972dc46a1f replace deprecated io/ioutil with os and io for cmd 2022-02-01 13:59:41 +08:00
Patrick Ohly
9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
haoyun
d2d21facc1 cleanup: remove insecure flag
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-08 12:02:43 +08:00
Kubernetes Prow Robot
c0b5ed7556
Merge pull request #105611 from damemi/simplified-multipoint-extension
Scheduler simplified MultiPoint plugin config
2021-11-16 17:44:12 -08:00
Mike Dame
420c5308bb Add MultiPoint scheduler plugin config field 2021-11-16 14:56:33 -05:00
sanchayanghosh
2131fdb84c
Changed the Info type so that the config file can be displayed without escape characters showing 2021-11-08 20:48:31 +05:45
Patrick Ohly
4df70dfd41 component-base: initialize logging as soon as possible
In various places log messages where emitted as part of validation or even
before it (for example, cli.PrintFlags). Those log messages did not use the
final logging configuration, for example text output instead of JSON or not the
final verbosity. The last point became more obvious after moving the setup of
verbosity into logs.Options.Apply because PrintFlags never printed anything
anymore.

In order to force applications to deal with logging as soon as possible, the
Options.Validate and Options.Apply methods are now private. Applications should
use the new Options.ValidateAndApply directly after parsing.
2021-11-03 11:55:54 +01:00
Wei Huang
e30f9648cc
sched: ensure feature gate is honored when instantiating scheduler (#105915)
* sched: ensure feature gate is honored when instantiating scheduler

* fixup: address comments
2021-11-02 14:28:06 -07:00
Wei Huang
7505701044
Revert "sched: ensure --leader-elect* CLI args are honored"
This reverts commit 3c230af59c.
2021-10-26 15:18:13 -07:00
Jordan Liggitt
bba877d3a6 Switch from json-iterator to utiljson 2021-10-20 12:49:23 -04:00
Wei Huang
3c230af59c
sched: ensure --leader-elect* CLI args are honored 2021-10-19 13:56:08 -07:00
kerthcet
a6f695581b remove legacy scheduler policy config, as well as associated flags policy-config-file, policy-configmap, policy-configmap-namespace and use-legacy-policy-config
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-10-08 23:57:49 +08:00
ravisantoshgudimetla
5c7f602f48 Make v1beta3 default 2021-10-07 10:58:06 -04:00
kerthcet
75a255d2ed remove scheduler component config v1beta1
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-09-28 13:13:17 +08:00
Wei Huang
a689ad4cda
sched: start dynamicInformerFactory along with regular informerFactory (#105016)
* sched: start dynamicInformerFactory along with regular informerFactory

* fixup: start all informers and then wait for their syncs
2021-09-16 19:33:00 -07:00
Jan Chaloupka
07af6697e9 refactor: disable insecure serving in kube-scheduler 2021-09-14 07:52:16 +02:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Dave Chen
5918869ed6 Revert 103327: "kube-scheduler: ensure the default config output of --write-to-config is usable"
We don't need to maually disable all the default plugins anymore

Signed-off-by: Dave Chen dave.chen@arm.com
2021-07-09 19:56:53 +08:00
Kubernetes Prow Robot
17f6f28621
Merge pull request #103468 from Huang-Wei/fix-sched-cc
instantiates scheduler ComponentConfig after parsing feature gates
2021-07-07 01:22:43 -07:00
Kubernetes Prow Robot
ea3bcbc205
Merge pull request #101946 from chendave/balance_allocation
Support extended resource in NodeResourcesBalancedAllocation plugin
2021-07-06 10:42:19 -07:00
Wei Huang
4c9c761bbb
instantiates scheduler ComponentConfig after parsing feature gates 2021-07-06 10:39:12 -07:00
SataQiu
6c86c34457 kube-scheduler: ensure the default config output of --write-to-config is usable 2021-06-30 13:26:27 +08:00
Dave Chen
1fa673c15c Extent the NodeResourcesBalancedAllocation plugin to cover more resources
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-06-30 11:15:12 +08:00
Kubernetes Prow Robot
e0f66be1aa
Merge pull request #101822 from yuzhiquan/NodeResourcesFit-score
Add score func for NodeResourcesFit plugin
2021-06-29 13:42:20 -07:00
yuzhiquan
deb14b995a Add score plugin for NodeResourcesFit 2021-06-29 13:16:55 -04:00
Abdullah Gharaibeh
b6a317aeaf add a function that returns default scheduler configuration 2021-06-24 11:48:35 -04:00