Commit Graph

132 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
6228b914ad
Merge pull request #114273 from TommyStarK/unit-tests/pkg-scheduler-internal
scheduler/internal: Improving cache and heap test coverage
2022-12-12 23:11:33 -08:00
TommyStarK
94a29efe2f scheduler/internal: Improving cache and heap test coverage
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2022-12-12 20:08:24 +01:00
kerthcet
180b082c49 Make the error messages in scheduler cache more precise
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-12-08 15:41:43 +08:00
Kubernetes Prow Robot
5e38528ef5
Merge pull request #110279 from sanposhiho/internal-cache
scheduler: Update cached Pod any time to make sure the Pod's status is up-to-date
2022-09-20 08:09:20 -07:00
Kensei Nakada
eba4d50c15 Update cached Pod to make sure the Pod's status is up-to-date 2022-09-17 14:32:08 +00:00
astraw99
ee24513e47 Fix scheduler misc 2022-09-04 00:07:49 +08:00
Kubernetes Prow Robot
9d9da4dc8b
Merge pull request #111968 from demoManito/fix/initmemory
Optimizing: make map cap
2022-08-24 09:36:03 -07:00
Kubernetes Prow Robot
8c9c287533
Merge pull request #111826 from yuanchen8911/master
Add pod info.  KObj(pod) to scheduler cache log
2022-08-23 19:01:27 -07:00
Kubernetes Prow Robot
84f9aaaf5e
Merge pull request #111816 from kidddddddddddddddddddddd/feat/FlushAndExit
replace os.Exit with FlushAndExit
2022-08-23 19:01:19 -07:00
Yuan Chen
974a41e55a Replace pod key with KObj(pod) in scheduler cache error msg
Add back pod key in scheduler cache

Add additional changes

Change podInfo to pod
2022-08-23 15:08:48 -07:00
demoManito
8ecb523b93 Optimize: code logic newNodeTree() 2022-08-23 17:37:39 +08:00
kidddddddddddddddddddddd
b5f0c34ef1 replace os.Exit with FlushAndExit 2022-08-12 17:34:13 +08:00
Wei Huang
7df9bfcfef
Expose a pending pods summary in scheudler's dummper output 2022-08-05 22:02:38 -07:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
kerthcet
72e8fc1d87 Fix: pod's deadline shoud be nil when cache ttl is 0
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-07-05 23:29:31 +08:00
Kapil Jain
4706dda5da Added code for disable scheduler cache expiry 2022-07-04 23:46:59 +05:30
Yibo Zhuang
fd08d47d8b cleanup: move scheduler tests to use PodWrapper
Move to use testing PodWrapper where applicable to
reduce duplicating pod creation code and shorten
number of lines.

Adding additional wrapper functions in PodWrapper
to ensure it covers all pod spec under tests.

Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
2022-05-05 10:48:26 -07:00
Yibo Zhuang
32c18a3479 Adding StorageInfoLister to SharedLister
This change creates a StorageInfoLister interface
and have it under scheduler SharedLister.

The initial StorageInfoLister interface has a
IsPVCUsedByPods which returns true/false depending on
whether the PVC (keyed by namespace/name) has at least
one scheduled pod using it.

In snapshot real implementation, add a usedPVCSet
key by PVC namespace/name which contains all PVCs
that have at least one scheduled pod using it.
During snapshot update, populate this set based on
whether the PVCRefCounts map for node(s) have been
updated since last snapshot.

Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
2022-05-03 18:00:41 -07:00
Kubernetes Prow Robot
317f8afe92
Merge pull request #108976 from ArangoGutierrez/devel/typos/scheduler
Fix typos under pkg/scheduler
2022-03-25 15:35:09 -07:00
Carlos Eduardo Arango Gutierrez
d2f67b42b7
Fix typos under pkg/scheduler
./scheduler/framework/plugins/noderesources/most_allocated_test.go:227: negtive ==> negative
./scheduler/framework/plugins/noderesources/most_allocated_test.go:228: negtive ==> negative
./scheduler/framework/plugins/volumebinding/binder.go:402: everytime ==> every time
./scheduler/framework/preemption/preemption_test.go:67: staus ==> status
./scheduler/framework/runtime/framework_test.go:1252: followings ==> following
./scheduler/internal/cache/cache_test.go:932: datas ==> data
./scheduler/internal/cache/node_tree_test.go:471: unknow ==> unknown
./scheduler/internal/queue/scheduling_queue_test.go:442: actived ==> activated
./scheduler/internal/queue/scheduling_queue_test.go:2209: covert ==> convert

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2022-03-24 08:01:25 -04: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
kerthcet
eafbaad9f7 refactor: rename SchedulerCache to Cache in Scheduler
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-02-24 09:47:21 +08:00
kerthcet
09623be0b1 refactor: rename schedulerCache to cacheImpl in internal cache
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-02-24 09:42:51 +08:00
BinacsLee
ccbd881b36 cleanup: remove switch for binary condition in scheduler cache 2022-01-12 21:08:16 +08:00
BinacsLee
1027b8de40 scheduler: fix race condition during cache refresh 2021-12-10 20:46:12 +08:00
Shivanshu Raj Shrivastava
1a079d7b86
migrated comparer.go, dumper.go, node_tree.go to structured logging 2021-11-10 00:53:38 +05:30
Shivanshu Raj Shrivastava
bb31040f06
migrate cache.go to structured logging 2021-11-07 19:20:39 +05:30
Aldo Culquicondor
ff741f6a96 Ensure deletion of pods in queues and cache
When the client misses a delete event from the watcher, it will use the last state of the pod in the informer cache to produce a delete event. At that point, it's not clear if the pod was in the queues or the cache, so we should issue a deletion in both.

The pod could be assumed, so deletion of assumed pods from the cache should work.

Change-Id: I11ce9785de603924fc121fe2fa6ed5cb1e16922f
2021-11-03 14:00:31 -04:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
ravisantoshgudimetla
b6c75bee15 Remove balanced attached node volumes
kubernetes#60525 introduced
Balanced attached node volumes feature gate to include volume
count for prioritizing nodes. The reason for introducing this
flag was its usefulness in Red Hat OpenShift Online environment
which is not being used any more. So, removing the flag
as it helps in maintainability of the scheduler code base
as mentioned at kubernetes#101489 (comment)
2021-06-22 11:19:30 -04:00
llhuii
3c899f9b54 sched: fix Dump's doc comment 2021-05-30 00:39:20 +08:00
Wei Huang
6384f397b4
sched: support PreEnqueueChecks prior to moving Pods 2021-03-11 12:31:50 -08:00
Mike Dame
af045087d9 Move GetZoneKey function to component-helpers 2021-03-04 10:32:38 -05:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
drfish
bc2df9de72 Use PodInfo instead of Pod for nominatedPods and QueuedPodInfo 2021-02-22 22:00:23 +08:00
Deepak Nair
49a9e28dd8 Substitute boolean maps with String sets 2021-02-18 20:59:32 -08:00
drfish
ebb6fb5b0c Organize scheduler unit tests into subtests 2021-02-02 21:41:20 +08:00
chymy
ed6475ae48 migrate pkg/scheduler/internal/cache/debugger/comparer.go to structured logs
Signed-off-by: chymy <chang.min1@zte.com.cn>
2021-02-01 11:20:05 +08:00
Tim Hockin
4068402459 Change trivial topology labels
In these cases the actual label key is incidental.
2020-11-12 11:21:37 -08:00
Tim Hockin
819ff9b087
Use topology labels instead of old beta names (#96033)
* Rename const for topology.../zone

* Rename const for topology.../region

* Rename const for failure-domain.../zone

* Rename const for failure-domain.../region

* Restore old names for compat
2020-11-05 20:26:50 -08:00
Kubernetes Prow Robot
43a0007fae
Merge pull request #96062 from Huang-Wei/sched-aware-of-nodes
Ensure created nodes are present in scheduler cache before scheduling
2020-11-05 13:13:05 -08:00
Wei Huang
f054765762
Add a function to ensure created nodes are present in scheduler cache 2020-11-03 15:25:44 -08:00
lixiaobing1
03cfd30ee2 fix n to nodeInfo easy to understand 2020-11-03 08:44:55 +08:00
Ali
09b2e8f638 Move scheduler interface to pkg/scheduler/framework 2020-10-13 13:13:27 +11:00
Kubernetes Prow Robot
3a987d5b85
Merge pull request #95130 from alculquicondor/fix-snapshot
Fix UpdateSnapshot when Node is partially removed
2020-09-28 21:31:38 -07:00
Aldo Culquicondor
d6f09f7dfb Fix UpdateSnapshot when Node is partially removed
Change-Id: I5b459e9ea67020183c87d1ce0a2380efb8cc3e05
2020-09-28 17:50:41 -04:00
Aldo Culquicondor
290bdf3f08 Fix test name TestDump
Change-Id: If885303b86060aed7a3e2aa20450cadd1f30752c
2020-09-28 15:30:05 -04:00
Kubernetes Prow Robot
d239cdfbc0
Merge pull request #94059 from ahg-g/ahg-anti-affinity
Track pods with required anti-affinity
2020-09-08 04:54:12 -07:00
Abdullah Gharaibeh
a8873e1a43 Track pods with required anti-affinity
This is a performance optimization that reduces the overhead of inter-pod affinity PreFilter calculaitons. Basically
eliminates that overhead when no pods in the cluster use required pod anti-affinity. This offered 20% improvement on 5k clusters for preferred anti-affinity benchmarks.
2020-08-21 10:09:21 -04:00
maelk
fc5edb8c12
Change nodeInfolist building logic in scheduler
This commit transforms the next() function of the scheduler node
tree into a listNodes() function that directly returns a list of
nodes, going through the zones in a round-robin fashion. This
removes the flawed logic of the next() function.
2020-08-18 11:35:14 +03:00