Skip to content

Commit 351505b

Browse files
authored
Merge pull request #1483 from alculquicondor/multi-scheduling-profiles
Set "Multi Scheduling Profiles" to "implementable"
2 parents 0ab0b11 + bf978ca commit 351505b

File tree

1 file changed

+63
-20
lines changed

1 file changed

+63
-20
lines changed

keps/sig-scheduling/20200114-multi-scheduling-profiles.md

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ approvers:
1212
editor: TBD
1313
creation-date: 2020-01-14
1414
last-updated: 2020-01-14
15-
status: provisional
15+
status: implementable
1616
see-also:
1717
- "/keps/sig-scheduling/20180409-scheduling-framework.md"
1818
- "/keps/sig-scheduling/20190226-default-even-pod-spreading.md"
@@ -42,17 +42,16 @@ see-also:
4242
- [Design Details](#design-details)
4343
- [Test Plan](#test-plan)
4444
- [Graduation Criteria](#graduation-criteria)
45-
- [Alpha -> Beta Graduation](#alpha---beta-graduation)
46-
- [Beta -> GA Graduation](#beta---ga-graduation)
45+
- [Alpha (v1.18):](#alpha-v118)
4746
- [Implementation History](#implementation-history)
4847
<!-- /toc -->
4948

5049
## Release Signoff Checklist
5150

5251
- [x] kubernetes/enhancements issue in release milestone, which links to KEP (this should be a link to the KEP location in kubernetes/enhancements, not the initial KEP PR)
53-
- [ ] KEP approvers have set the KEP status to `implementable`
54-
- [ ] Design details are appropriately documented
55-
- [ ] Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
52+
- [x] KEP approvers have set the KEP status to `implementable`
53+
- [x] Design details are appropriately documented
54+
- [x] Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
5655
- [ ] Graduation criteria is in place
5756
- [ ] "Implementation History" section is up-to-date for milestone
5857
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
@@ -136,6 +135,7 @@ looks like the following:
136135
type KubeSchedulerConfiguration struct {
137136
...
138137
SchedulerName string
138+
AlgorithmSource SchedulerAlgorithmSource
139139
HardPodAffinitySymmetricWeight
140140
Plugins *Plugins
141141
PluginConfig []PluginConfig
@@ -158,14 +158,21 @@ type KubeSchedulerProfile struct {
158158
}
159159
```
160160

161+
Note that we remove `AlgorithmSource` from the new API. Its functionality becomes redundant to
162+
what can be configured with `Plugins` and `PluginConfig`.
163+
161164
##### Conversion between API versions
162165

163-
During conversion from `v1alpha1` to `v1alpha2`, we will copy all the necessary
164-
parameters from KubeSchedulerConfiguration into one item in the `Profiles` list.
166+
During conversion of `kubescheduler.config.k8s.io` from `v1alpha1` to `v1alpha2`, we will copy all
167+
the necessary parameters from KubeSchedulerConfiguration into one item in the `Profiles` list.
168+
169+
In particular, configurations done by using `AlgorithmSource` will produce different values for
170+
`Plugins` and `PluginConfig`.
171+
This is similar to what we already do internally in [`legacy_registry.go`](
172+
https://github.com/kubernetes/kubernetes/blob/fb66e807cd317254e5c7bf134186ddbfba757ef4/pkg/scheduler/framework/plugins/legacy_registry.go#L149)
165173

166174
`HardPodAffinitySymmetricWeight` would be moved to be a `PluginConfig.Arg` in
167-
the `PluginConfig` slice for the plugin `InterPodAffinity` as
168-
`HardPodAffinityWeight`.
175+
the `PluginConfig` slice for the plugin `InterPodAffinity` as `HardPodAffinityWeight`.
169176

170177
##### Defaults
171178

@@ -192,16 +199,20 @@ similar result as the binary is starting.
192199
`SchedulerName` values will be validated to not repeat among the items of
193200
`Profiles`.
194201

202+
Since kube-scheduler has only one queue, we will validate that all `Plugins.QueueSort`
203+
configurations are strictly the same.
204+
195205
##### CLI flags binding
196206

197-
Note that, if component config is used, deprecated flags are currently ignored,
198-
which includes `scheduler-name` and `hard-pod-affinity-symmetric-weight`. This
199-
implies that we only have to worry about these flags in relationship with the
200-
default profile.
207+
Note that, if component config is used, deprecated flags are currently ignored, which includes
208+
`scheduler-name`, `algorithm-provider` and `hard-pod-affinity-symmetric-weight`. This implies
209+
that we only have to worry about these flags in relationship with the default profile.
201210

202211
Thus, if component config is not used, we will preserve the behavior of the
203212
flags as follows:
204213
- `scheduler-name` will be bound to its counterpart in the default profile.
214+
- `algorithm-provider` will produce different `Plugins` configurations. For examples, it will
215+
produce an empty configuration for `default-scheduler`.
205216
- `hard-pod-affinity-symmetric-weight` will be bound to a new deprecated option
206217
that will be processed into a `pluginConfig` slice of the default profile,
207218
like follows:
@@ -230,6 +241,10 @@ the scheduler queue.
230241
framework instance from the registry corresponding to the specified scheduler
231242
name.
232243

244+
Note that all framework instances will make use of the same shared cache
245+
(for nodes and pods), from which a snapshot is taken for each scheduling cycle.
246+
This is the main advantage over running multiple schedulers in a cluster.
247+
233248
### Risks and Mitigations
234249

235250
Operators could introduce profiles that disable scheduling features exposed in
@@ -244,19 +259,47 @@ the scheduler documentation.
244259

245260
### Test Plan
246261

247-
TODO
262+
The following tests need to be in place:
263+
264+
- **Unit Tests**:
265+
- Component Config API conversion, validation and defaults
266+
- Core scheduler implementation. Current tests that use a default scheduler
267+
(or default framework) should continue passing with no configuration changes.
268+
- **Integration tests**: Current tests with a default scheduler should continue passing with no
269+
configuration changes. We need new tests in `test/integration/scheduler` exercising more than one
270+
profile, in which:
271+
- Each profile would favor specific nodes, so that we can verify assignment.
272+
- Pods get binding events for the selected scheduler name.
273+
- Pods that don't specify a scheduler name continue to be scheduled by the default profile.
274+
275+
*Note on E2E tests*
276+
277+
Due to the proposed architecture, where a single kube-scheduler binary runs all the profiles, E2E
278+
tests wouldn't increase the coverage of this feature over unit and integration tests.
279+
Additionally, profiles can only be provided statically during cluster creation with our current
280+
test infra. This implies that an independent job would be needed for each scheduler configuration.
281+
But, as stated in our goals, this KEP doesn't introduce new default profiles.
248282

249283
### Graduation Criteria
250284

251-
##### Alpha -> Beta Graduation
285+
#### Alpha (v1.18):
252286

253-
TODO
287+
These are the required changes:
254288

255-
##### Beta -> GA Graduation
289+
- [ ] New `kubescheduler.config.k8s.io/v1alpha2` API.
290+
- [ ] Conversion from `kubescheduler.config.k8s.io/v1alpha1`
291+
- [ ] Validation.
292+
- [ ] Defaults.
293+
- [ ] Scheduler can run more than one framework:
294+
- [ ] Scheduler adds unscheduled pods to the pending queue for more than one name.
295+
- [ ] Scheduler uses a framework using the scheduler name specified by the pod.
296+
- [ ] Tests from [Test Plan](#test-plan).
256297

257-
TODO
298+
Note that we don't require a feature gate as users already have to opt-in by using
299+
`kubescheduler.config.k8s.io/v1alpha2` instead of the previous version.
258300

259301
## Implementation History
260302

261303
- 2020-01-14: Initial KEP sent out for review, including Summary, Motivation
262-
and Proposal
304+
and Proposal.
305+
- 2020-01-21: Test Plan and Alpha Graduation criteria in KEP.

0 commit comments

Comments
 (0)