Commit Graph

56 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Wei Huang
6384f397b4
sched: support PreEnqueueChecks prior to moving Pods 2021-03-11 12:31:50 -08:00
drfish
ebb6fb5b0c Organize scheduler unit tests into subtests 2021-02-02 21:41:20 +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
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
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
Aldo Culquicondor
dfe9e413d9 Keep track of remaining pods when a node is deleted.
The apiserver is expected to send pod deletion events that might arrive at a different time. However, sometimes a node could be recreated without its pods being deleted.

Partial revert of https://github.com/kubernetes/kubernetes/pull/86964

Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: I51f683e5f05689b711c81ebff34e7118b5337571
2020-08-13 14:24:01 -04:00
Aldo Culquicondor
16d7ecfa45 Remove direct accesses to cache's node map
Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: Iebb22fc816926aaa1ddd1e4b2e52f335a275ffaa
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-08-13 14:22:06 -04:00
Maël Kimmerlin
c2ec8bedbc
Fix scheduler issue with nodetree additions
When nodes are added in multiple zones at once, the nodeTree next
function does not return a correct list of nodes but repeats some
This commit resets the index before starting to call next() to
prevent this issue

Special thanks to igraecao for the help in finding the bug

Co-authored-by: igraecao <matvej.yolli@outlook.com>
2020-07-24 09:42:53 +03:00
Abdullah Gharaibeh
2c51c13620 Scheduler NodeInfo cleanup 2020-04-09 19:03:51 -04:00
Kubernetes Prow Robot
0c9245a29f
Merge pull request #89974 from ahg-g/ahg-info
scheduler's NodeInfo tracks PodInfos instead of Pods
2020-04-09 09:19:58 -07:00
Abdullah Gharaibeh
b8ddd00312 scheduler's NodeInfo tracks PodInfos instead of Pods 2020-04-08 17:53:20 -04:00
Kubernetes Prow Robot
1edbfe1745
Merge pull request #89908 from alculquicondor/fix_cache
Skip updating scheduler cache on pod update if the node was deleted
2020-04-07 16:46:06 -07:00
Aldo Culquicondor
e75b5dcfe4 Skip updating cache on pod update if the node was deleted
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-04-07 13:24:42 -04:00
Abdullah Gharaibeh
a5d8172715 move nodeinfo type to framework pkg 2020-04-07 10:25:24 -04:00
Abdullah Gharaibeh
ed3fe054df move scheduler nodeinfo to pkg/scheduler/types 2020-03-31 21:02:09 -04:00
Aldo Culquicondor
7a39e1396a Remove unnecessary slow binding test
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-20 11:49:45 -05:00
Aldo Culquicondor
f53d7e55df Move Snapshot from nodeinfo/snapshot to internal/cache
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-17 13:29:41 -05:00
Aldo Culquicondor
6a14203658 Rename cache's Snapshot to Dump
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-17 11:28:08 -05:00
Wei Huang
b2159b5d66
Remove scheduler/algorithm/priorities/util package 2020-01-09 20:16:05 -08:00
Aldo Culquicondor
afe3b907a1 Remove nodes from cache immediately on delete events
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-09 12:58:12 -05:00
Abdullah Gharaibeh
5ea43f20cb optimize scheduler's UpdateNodeInfoSnapshot 2019-11-29 15:06:13 -05:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Abdullah Gharaibeh
8ec56aeafb Change all scheduler's Node and Pod list/lookups to be from the snapshot rather than the cache. 2019-10-25 14:24:55 -04:00
Abdullah Gharaibeh
373cf8c1b1 move nodeinfo/snapshot.go into its own package 2019-10-23 16:12:13 -04:00
Abdullah Gharaibeh
d393804237 separate listers into their own package 2019-10-22 18:11:02 -04:00
Abdullah Gharaibeh
63d7733e98 create an ordered list of nodes instead of iterating over the tree 2019-10-18 12:51:46 -04:00
draveness
ffef11f768 feat(scheduler): move node info snapshot out of internal package 2019-08-23 22:32:16 +08:00
ahg-g
ece3e3cdba
Revert "Faster scheduler" 2019-06-06 22:34:18 -04:00
Kubernetes Prow Robot
baa2030683
Merge pull request #77509 from ahg-g/faster_scheduler
Faster scheduler
2019-05-08 17:15:00 -07:00
Andrew Kim
c919139245 update import of generic featuregate code from k8s.io/apiserver/pkg/util/feature -> k8s.io/component-base/featuregate 2019-05-08 10:01:50 -04:00
Abdullah Gharaibeh
e660e84459 Faster scheduler. 2019-05-08 09:49:01 -04:00
Bobby (Babak) Salamat
404dc1ed79 Update scheduler framework plugins to align with the latest changes to the framework design 2019-04-29 16:40:56 -07:00
Wei Huang
49346c1e04
shorten scheduler package alias for better readability
- schedulerinternalcache -> internalcache
2019-03-21 18:14:19 -07:00
yanghaichao12
b475cdf7fc Fix typos
change SupportsPreemption

change comment again
2019-03-05 02:12:55 -05:00
Bobby (Babak) Salamat
337cb7036c Add tests for the new cache snapshotting mechanism. 2019-02-20 13:38:37 -08:00
Bobby (Babak) Salamat
e0ad271891 Optimize scheduler cache snapshotting using an MRU structure. 2019-02-20 13:38:37 -08:00