Commit Graph

947 Commits

Author SHA1 Message Date
carlory
0599b3caa0 change the QueueingHintFn to pass a logger 2023-07-13 00:56:41 +08:00
Patrick Ohly
6f1a29520f scheduler/dra: reduce pod scheduling latency
This is a combination of two related enhancements:
- By implementing a PreEnqueue check, the initial pod scheduling
  attempt for a pod with a claim template gets avoided when the claim
  does not exist yet.
- By implementing cluster event checks, only those pods get
  scheduled for which something changed, and they get scheduled
  immediately without delay.
2023-07-12 11:17:04 +02:00
Patrick Ohly
ef48efc736 scheduler dynamicresources: minor logging improvements
This makes some complex values a bit more readable.
2023-07-12 11:07:59 +02:00
Kubernetes Prow Robot
e0dafe57a3
Merge pull request #117351 from pohly/dra-generated-resource-claim-names
DRA: generated resource claim names
2023-07-11 10:33:11 -07:00
Patrick Ohly
444d23bd2f dra: generated name for ResourceClaim from template
Generating the name avoids all potential name collisions. It's not clear how
much of a problem that was because users can avoid them and the deterministic
names for generic ephemeral volumes have not led to reports from users. But
using generated names is not too hard either.

What makes it relatively easy is that the new pod.status.resourceClaimStatus
map stores the generated name for kubelet and node authorizer, i.e. the
information in the pod is sufficient to determine the name of the
ResourceClaim.

The resource claim controller becomes a bit more complex and now needs
permission to modify the pod status. The new failure scenario of "ResourceClaim
created, updating pod status fails" is handled with the help of a new special
"resource.kubernetes.io/pod-claim-name" annotation that together with the owner
reference identifies exactly for what a ResourceClaim was generated, so
updating the pod status can be retried for existing ResourceClaims.

The transition from deterministic names is handled with a special case for that
recovery code path: a ResourceClaim with no annotation and a name that follows
the Kubernetes <= 1.27 naming pattern is assumed to be generated for that pod
claim and gets added to the pod status.

There's no immediate need for it, but just in case that it may become relevant,
the name of the generated ResourceClaim may also be left unset to record that
no claim was needed. Components processing such a pod can skip whatever they
normally would do for the claim. To ensure that they do and also cover other
cases properly ("no known field is set", "must check ownership"),
resourceclaim.Name gets extended.
2023-07-11 14:23:48 +02:00
Kubernetes Prow Robot
c95b16b280
Merge pull request #118608 from utam0k/podtopologyspread-prescore-skip
Return Skip in PodTopologySpread#PreScore under specific conditions
2023-07-10 09:27:07 -07:00
Kubernetes Prow Robot
0ae9aaacfa
Merge pull request #118271 from tangwz/add_nodeports_prefilter_skip_status
feat(NodePorts): return Skip status in PreFilter
2023-07-09 20:49:04 -07:00
Gunju Kim
7286d122fb
Mark pods with restartable init containers as UnschedulableAndUnresolvable
This marks the pods with restartable init containers as
`UnschedulableAndUnresolvable` if the feature gate is disabled to avoid
the inconsistency in resource calculation between the scheduler and the
older kubelet.
2023-07-08 07:26:13 +09:00
tangwz
1bf2f6c9c0 feat(NodePorts): return Skip status in PreFilter 2023-07-06 08:42:08 +08:00
utam0k
ef26510164
Return Skip in PodTopologySpread#PreScore under specific conditions
Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-06-28 12:08:10 +00:00
Kubernetes Prow Robot
52457842d1
Merge pull request #117055 from cyclinder/csi_migration
remove CSI-migration gate
2023-06-28 04:28:31 -07:00
Kubernetes Prow Robot
d9714078f8
Merge pull request #118551 from sanposhiho/event-to-register
feature(scheduler): implement ClusterEventWithHint to filter out useless events
2023-06-26 06:41:45 -07:00
Kensei Nakada
6f8d38406a feature(scheduler): implement ClusterEventWithHint to filter out useless events 2023-06-22 13:36:19 +00:00
Kubernetes Prow Robot
bc8e312857
Merge pull request #117903 from sourcelliu/dynamic
feature(DynamicResources): return Skip in PreFilter
2023-06-20 17:48:20 -07:00
Kubernetes Prow Robot
4483bf66fe
Merge pull request #116635 from mengjiao-liu/contextual-logging-plugin-interpodaffinity
Migrated `pkg/scheduler/framework/plugins/interpodaffinity` to contextual logging
2023-06-09 08:14:13 -07:00
SataQiu
410b6023d6 scheduler: fix code style issues for pkg/scheduler 2023-06-05 17:29:49 +08:00
cyclinder
8e4228a8c1 remove CSI-migration gate 2023-06-04 18:40:17 +08:00
Mengjiao Liu
6d23da045f Migrated pkg/scheduler/framework/plugins/interpodaffinity to use contextual logging 2023-06-01 18:24:54 +08:00
Mengjiao Liu
074900e81b scheduler: update the scheduler interface and cache methods to use contextual logging 2023-05-29 13:26:32 +08:00
Kubernetes Prow Robot
f7cfb5f02f
Merge pull request #118257 from pohly/dra-scheduler-plugin-loopvar-fix
dra scheduler plugin test: fix loopvar bug and "reserve" expected data
2023-05-26 06:06:53 -07:00
Patrick Ohly
7a6b4a9215 dra scheduler plugin test: fix loopvar bug and "reserve" expected data
The `listAll` function returned a slice where all pointers referred to the same
instance. That instance had the value of the last list entry. As a result, unit
tests only compared that element.

During the reserve phase, the first claim gets reserved in two test
cases. Those two tests must expect that change. That hadn't been noticed before
because that first claim didn't get compared.
2023-05-25 15:10:05 +02:00
Mengjiao Liu
1c05cf1d51 kube-scheduler: NewFramework function to pass the context parameter
Co-authored-by: Aldo Culquicondor <1299064+alculquicondor@users.noreply.github.com>
2023-05-23 10:17:34 +08:00
Kubernetes Prow Robot
c7c41d27b4
Merge pull request #117834 from NoicFank/cleanup-scheduler-node-must-not-nil-in-snapshot
cleanup useless null pointer check about nodeInfo.Node() from snapshot for in-tree plugins
2023-05-20 15:16:18 -07:00
dingzhu lurong
ed26fcf5b8 cleanup useless null pointer check about nodeInfo.Node() from snapshot for in-tree plugins 2023-05-20 22:53:43 +08:00
Kubernetes Prow Robot
da1b9df26c
Merge pull request #118032 from kerthcet/cleanup/interpodaffinity2
Chore: cleanup in interPodAffinity
2023-05-17 14:00:33 -07:00
Kubernetes Prow Robot
53772982be
Merge pull request #116829 from mengjiao-liu/contextual-logging-scheduler-plugin-volumezone
Migrated the volumezone scheduler plugin to use contextual logging
2023-05-16 09:53:35 -07:00
kerthcet
3ac7497361 Chore: cleanup in interpodaffinity
Signed-off-by: kerthcet <kerthcet@gmail.com>
2023-05-16 14:46:15 +08:00
mantuliu
6e2ea32fc8 feature(DynamicResources): return Skip in PreFilter 2023-05-15 00:06:08 +08:00
Kubernetes Prow Robot
58e13496d6
Merge pull request #116842 from mengjiao-liu/contextual-logging-scheduler-runtime
Migrated `pkg/scheduler/framework/runtime` to use contextual logging
2023-05-11 10:59:02 -07:00
Mengjiao Liu
fe728996ca scheduler test: call frameworkruntime.WithLogger function for contextual logging 2023-05-11 15:46:08 +08:00
utam0k
c0611b6bb3
Return Skip in InterPodAffinity#PreScore under specific conditions
This commit updates the InterPodAffinity PreScore to return a Skip status when the following conditions are met:
1. There are no nodes to score.
2. The incoming pod has no inter-pod affinities && the `IgnorePreferredTermsOfExistingPods` option is enabled.

Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-05-10 13:02:23 +00:00
Kubernetes Prow Robot
47f1bd9f80
Merge pull request #117649 from SataQiu/scheduler-remove-v1beta2-20230427
scheduler: remove deprecated v1beta2 KubeSchedulerConfiguration  component config
2023-05-03 09:54:41 -07:00
Kubernetes Prow Robot
0d67dd689b
Merge pull request #117683 from utam0k/skip-topologyspread-empty
Add check to skip PodTopologySpread PreFilter if no constraints are specified
2023-05-03 06:48:24 -07:00
SataQiu
1f7c07f355 scheduler: remove deprecated v1beta2 KubeSchedulerConfiguration 2023-05-03 21:43:19 +08:00
utam0k
d82684e691
Add check to skip PodTopologySpread PreFilter if no constraints are specified
This commit adds a check in the PodTopologySpread PreFilter function to
return a Skip status if there are no topology spread constraints specified
This prevents unnecessary processing and filtering for pods that don't have any topology spread
constraints.
This change is a part of the work for issue #114399.

Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-05-03 04:39:00 +00:00
Kubernetes Prow Robot
8353d4623b
Merge pull request #117427 from cbandy/pkg-testing-setenv
Replace os.Setenv with testing.T.Setenv in tests
2023-04-29 08:28:16 -07:00
Kubernetes Prow Robot
b44482a37c
Merge pull request #116797 from mengjiao-liu/contextual-looging-scheduler-plugin-podtopologyspread
Migrated `pkg/scheduler/framework/plugins/podtopologyspread` to contextual logging
2023-04-27 12:28:27 -07:00
Kubernetes Prow Robot
a38efaccc0
Merge pull request #116748 from mengjiao-liu/contextual-logging-scheduler-plugin-noderesource
Migrated `pkg/scheduler/framework/plugins/noderesources` to contextual logging
2023-04-27 12:28:15 -07:00
Kubernetes Prow Robot
5170c25609
Merge pull request #116835 from mengjiao-liu/contextual-logging-scheduler-plugin-preemption
Migrated `pkg/scheduler/framework/preemption & defaultpreemption` to use contextual logging
2023-04-27 11:10:16 -07:00
Kubernetes Prow Robot
87f3acf7f6
Merge pull request #115398 from tangwz/add_NodeVolumeLimits_PreFilter
feat(NodeVolumeLimits): return Skip in PreFilter
2023-04-27 01:44:14 -07:00
Mengjiao Liu
7f370d651d Migrated pkg/scheduler/framework/plugins/podtopologyspread to contextual logging 2023-04-27 15:55:09 +08:00
Mengjiao Liu
54e6f609ce Migrated pkg/scheduler/framework/plugins/noderesources to contextual logging 2023-04-27 14:46:13 +08:00
Mengjiao Liu
37a9260d5c Migrate pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go to use contextual logging 2023-04-27 11:28:19 +08:00
Mengjiao Liu
eeb1399383 Migrated pkg/scheduler/framework/preemption to use contextual logging 2023-04-27 11:28:14 +08:00
tangwz
8ed861889a feat(NodeVolumeLimits): return Skip in PreFilter 2023-04-26 20:17:04 +08:00
Maciej Borsz
5c584269a7 avoid volume copy in checkAttachableInlineVolume 2023-04-19 20:10:22 +00:00
Chris Bandy
d38ac7e7c6 Replace os.Setenv with testing.T.Setenv in tests
T.Setenv ensures that the environment is returned to its prior state
when the test ends. It also panics when called from a parallel test to
prevent racy test interdependencies.
2023-04-17 20:39:46 -05:00
Kubernetes Prow Robot
94a15929cf
Merge pull request #116408 from ChenLingPeng/fit
skip pod resource check when request is zero
2023-04-17 11:44:45 -07:00
Kubernetes Prow Robot
242702cb86
Merge pull request #116940 from sarab97/sarab/feat/sets
Use the generic Set in scheduler
2023-04-11 19:17:14 -07:00
Kubernetes Prow Robot
365ac69fc4
Merge pull request #116845 from major1201/fix_binder_typo
fix GetPodVolumeClaims in comments
2023-04-11 18:20:05 -07:00