Skip to content

Commit 3eddab7

Browse files
committed
Addressed comments
1 parent 20b3c07 commit 3eddab7

File tree

3 files changed

+47
-58
lines changed

3 files changed

+47
-58
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
kep-number: 5234
22
alpha:
3-
approver: "@johnbelamaric"
3+
approver: "@johnbelamaric"

keps/sig-scheduling/5234-dra-resourceslice-mixins/README.md

+44-55
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ SIG Architecture for cross-cutting KEPs).
6969
- [Proposal](#proposal)
7070
- [Risks and Mitigations](#risks-and-mitigations)
7171
- [ResourceSlice resources will be harder to understand](#resourceslice-resources-will-be-harder-to-understand)
72+
- [Flatting of ResourceSlices might be needed by all tools using the API](#flatting-of-resourceslices-might-be-needed-by-all-tools-using-the-api)
7273
- [More attributes, capacities and counters might worsen worst-case scheduling](#more-attributes-capacities-and-counters-might-worsen-worst-case-scheduling)
7374
- [Design Details](#design-details)
7475
- [API](#api)
@@ -163,7 +164,8 @@ capacity. This has a few consequences:
163164
duplication between the published devices.
164165
* The size of the data required to specify each device reduces the number of
165166
devices that can be defined in a single ResourceSlice without hitting the
166-
Kubernetes size limit.
167+
limit on the total size of objects in Kubernetes (1.5MB by default, but can
168+
be changed).
167169

168170
The latter can be addressed by splitting the devices across multiple
169171
`ResourceSlice`s within a single pool, but that isn't always an option.
@@ -192,43 +194,41 @@ The proposal has two parts to it, the definition of mixins and the
192194
mechanism for referencing mixins from devices and counter sets.
193195

194196
A new `Mixins` field will be added to the `ResourceSliceSpec` as an
195-
optional field. It will have three properties, one for each of the three
197+
optional field of type `ResourceSliceMixins`. It will have three properties, one for each of the three
196198
types of mixins that will be supported:
197199

198200
1. The `CounterSet` field defines a list of named `CounterSetMixins`.
199201
These define counters that can be used to extend the counters
200202
explicitly defined in a `CounterSet`. This allows for reduced duplication
201203
if there are many identical physical devices that must be represented as
202-
`CounterSet`s. `CounterSetMixins` can not be referenced directly by devices.
204+
`CounterSet`s. `CounterSetMixins` cannot be referenced directly by devices.
203205

204206
1. The `Device` field is a list of named `DeviceMixin`s. These define
205207
attributes and capacities that can be used to extend what is defined
206208
explicitly in `Device`. `DeviceMixin`s cannot be allocated directly, but can
207209
only be referenced by devices.
208210

209211
1. The `DeviceCounterConsumption` field defines a list of named
210-
`DeviceCounterConsumptionMixin`s. These define counters that can be
211-
used to extend the counter consumption defined explicitly in `DeviceCounterConsumption`
212-
in the `ConsumesCounters` list on `Device`. The `CounterSet` from
213-
which the counters will be consumed is not specified in the
214-
`DeviceCounterConsumptionMixin`, but rather provided when the mixin is
215-
referenced from the device.
212+
`DeviceCounterConsumptionMixin`s. These define the pattern of consumption of
213+
counters, distinct from the specific underlying counter set from which they
214+
are being consumed. The `CounterSet` from which the counters will be consumed
215+
is not specified in the `DeviceCounterConsumptionMixin`, but rather provided
216+
when the mixin is referenced from the device.
216217

217218
The mixins are referenced using the same pattern in all three places. The field
218-
is named `Includes` and will contain a list of references to the mixins. Rather
219-
than representing the references as a list of strings, there is a list of type
220-
`<SomeType>MixinRef` which has a `Name` field. This enables adding additional
221-
values to the reference in the future.
219+
is named `Includes` and will contain a list of references to the mixins. The mixins
220+
are applied in the order listed, meaning that later mixins will overwrite earlier
221+
ones in case of conflicts. Properties set directly on the `CounterSet`, `Device` or
222+
`DeviceCounterConsumption` will always override mixins.
222223

223-
1. The `Includes` field on `CounterSet` is a list of `CounterSetMixinRef`s. This
224-
can reference mixins defined in the `CounterSet` field on the `ResourceSliceMixins`.
224+
1. The `Includes` field on `CounterSet` is a list of references
225+
to mixins defined in the `CounterSet` field on the `ResourceSliceMixins`.
225226

226-
1. The `Includes` field on `Device` is a list of of `DeviceMixinRef`s. This can
227-
reference mixins defined in the `Device` field on the `ResourceSliceMixins`.
227+
1. The `Includes` field on `Device` is a list of references to mixins defined
228+
in the `Device` field on the `ResourceSliceMixins`.
228229

229-
1. The `Includes` field on `DeviceCounterConsumption` is a list of
230-
`DeviceCounterConsumptionMixinRef`s. This can reference mixins defined
231-
in the `DeviceCounterConsumption` field on the `ResourceSliceMixins`.
230+
1. The `Includes` field on `DeviceCounterConsumption` is a list of references
231+
to mixins defined in the `DeviceCounterConsumption` field on the `ResourceSliceMixins`.
232232

233233
With these changes, attributes, capacity, and counters that are shared across
234234
devices or counter sets can be split out into mixins, thereby reducing
@@ -250,17 +250,32 @@ We have discussed adding a kubectl command or a plugin that will allow
250250
users to see the fully flattened versions of a ResourceSlice. But this
251251
is not in scope for alpha.
252252

253+
#### Flatting of ResourceSlices might be needed by all tools using the API
254+
255+
Any tool that needs to understand the full device definition will need to
256+
flatten the ResourceSlice. This can lead to duplicate effort across different
257+
tools and potential for implementations that differ in meaningful ways. This can
258+
be addressed by providing reusable libraries that can be leveraged by other
259+
tools.
260+
253261
#### More attributes, capacities and counters might worsen worst-case scheduling
254262

255-
With mixins, DRA driver authors can choose to create more complex devices,
256-
which might lead to worse scheduling performance. But it is up to DRA driver
257-
authors to do this, so it is not something that can be triggered by normal users.
263+
This will not negatively effect existing scheduling performance of existing
264+
ResourceSlice definitions, but DRA driver authors taking advantage of mixins should
265+
be made aware of possible performance effects due to this increased referential complexity.
266+
267+
This also demonstrates that DRA driver authors should consider performancer when they
268+
write drivers and decide how to structure devices into ResourceSlices and pools. Information
269+
and best-practices about how to write drivers are available in
270+
https://github.com/kubernetes-sigs/dra-example-driver and this will also include information
271+
about performance and scalability.
258272

259273
## Design Details
260274

261275
### API
262276

263-
The exact set of proposed API changes can be seen below:
277+
The exact set of proposed API changes can be seen below (`...` is used in places where new fields
278+
are added to existing types):
264279
```go
265280
// ResourceSliceSpec contains the information published by the driver in one ResourceSlice.
266281
type ResourceSliceSpec struct {
@@ -294,16 +309,7 @@ type CounterSet struct {
294309
// +featureGate=DRAResourceSliceMixins
295310
// +listType=atomic
296311
// +optional
297-
Includes []CounterSetMixinRef
298-
}
299-
300-
// CounterSetMixinRef defines a reference to a CounterSetMixin.
301-
type CounterSetMixinRef struct {
302-
// Name refers to a CounterSetMixin defined in the same
303-
// ResourceSlice.
304-
//
305-
// +required
306-
Name string
312+
Includes []string
307313
}
308314

309315
// ResourceSliceMixins defines mixins for the ResourceSlice.
@@ -437,16 +443,7 @@ type Device struct {
437443
// +featureGate=DRAResourceSliceMixins
438444
// +optional
439445
// +listType=atomic
440-
Includes []DeviceMixinRef
441-
}
442-
443-
// DeviceMixinRef defines a reference to a DeviceMixin.
444-
type DeviceMixinRef struct {
445-
// Name refers to a DeviceMixin defined in the same
446-
// ResourceSlice.
447-
//
448-
// +required
449-
Name string
446+
Includes []string
450447
}
451448

452449
type DeviceCounterConsumption struct {
@@ -469,17 +466,7 @@ type DeviceCounterConsumption struct {
469466
// +featureGate=DRAResourceSliceMixins
470467
// +optional
471468
// +listType=atomic
472-
Includes []DeviceCounterConsumptionMixinRef
473-
}
474-
475-
// DeviceCapacityConsumptionMixinRef defines a reference to a
476-
// DeviceCapacityConsumptionMixin.
477-
type DeviceCounterConsumptionMixinRef struct {
478-
// Name refers to a DeviceCounterConsumptionMixin defined in the same
479-
// ResourceSlice.
480-
//
481-
// +required
482-
Name string
469+
Includes []string
483470
}
484471
```
485472

@@ -600,6 +587,8 @@ If the APIServer is at 1.34 and the scheduler is at 1.33, the APIServer will sen
600587
the new fields, but the scheduler will not know what to do about them. It will end
601588
up ignoring them, which can lead to incorrect scheduling decisions. Note that this
602589
scenario only applies to the initial 1.34 release and will not apply for 1.35+.
590+
The recommendation is that the user should not enable this alpha feature unless
591+
the scheduler is updated to 1.34 and enables the alpha feature as well.
603592

604593
## Production Readiness Review Questionnaire
605594

keps/sig-scheduling/5234-dra-resourceslice-mixins/kep.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ reviewers:
1515
- "@thockin"
1616
approvers:
1717
- "@mrunalp" # SIG-Node
18-
- "@alculquicondor" # SIG-Scheduling
19-
- "@MaciekPytel" # SIG-Autoscaling
18+
- "@dom4ha" # SIG-Scheduling
19+
- "@jackfrancis" # SIG-Autoscaling
2020
- "@thockin" # API Review
2121

2222
see-also:

0 commit comments

Comments
 (0)