@@ -255,36 +255,40 @@ nitty-gritty.
255255The ` ResourceClaim ` object contains a ` DeviceClaim ` , which in turn contains a
256256list of ` DeviceRequest ` objects. This allows the user to allocate different
257257types of devices for the same claim, and apply constraints and configuration
258- across those different requests.
259-
260- The proposal restructures the ` DeviceRequest ` object so there will be a
261- ` Name ` field just like today, but for supporting either a single request
262- or a prioritized list there will be the fields ` Exactly ` for a request without
263- alternatives (type ` SpecificDeviceRequest ` ) and ` FirstAvailable ` for providing a
264- prioritized list of requests (type ` DeviceSubRequest ` ). The other fields that are
265- currently in the ` DeviceRequest ` object will be moved into one or both of the
266- ` SpecifiecDeviceRequest ` and ` DeviceSubRequest ` objects.
267- The list provided in the ` FirstAvailable ` field is
268- considered a priority order, such that the scheduler will only try to use
269- the second item in the list if it is unable to satisfy the first item,
270- and so on. The ` Exactly ` and ` FirstAvailable ` fields are mutually exclusive.
271- This is a breaking change to the ` v1beta1 ` API, so this will be added in a
272- new ` v1beta2 ` resource API.
273-
274- For the ` v1beta1 ` API, there will be a new field called ` FirstAvailable `
258+ across those different requests. These changes allow some flexibility for the
259+ user to create, say, a "gpu" request, but allow it to be satisfied by one of
260+ several models of GPU.
261+
262+ To avoid introducing a breaking API change and to ensure round-tripping
263+ between the APIs, the ` v1beta1 ` API will remain backward compatible
264+ (only extended) and the final change will be made in ` v1beta2 ` .
265+
266+ The ` v1beta1 ` API will be extended with a new field called ` FirstAvailable `
275267which will contain an ordered list of ` DeviceSubRequest ` objects. In order to
276268satisfy the main (containing) request, exactly one of the requests listed in
277269` FirstAvailable ` must be satisfied. The order listed is considered a priority
278270order, such that the scheduler will only try to use the second item in the list
279271if it is unable to satisfy the first item, and so on. This extension to the API
280272is not breaking, but it makes for a somewhat awkward API where many fields on
281- the ` DeviceRequest ` (in fact all existing fields except ` Name ` ) should not be
282- used whenever ` FirstAvailable ` is used. To avoid this long term we are
283- adding the ` v1beta2 ` API described above, while doing the backwards-compatible
284- change in the ` v1beta1 ` API to ensure round-tripping between the APIs will work.
285-
286- These changes allow some flexibility for the user to create, say, a "gpu"
287- request, but allow it to be satisfied by one of several models of GPU.
273+ the ` DeviceRequest ` (in fact all existing fields except ` Name ` ) must not be
274+ set whenever ` FirstAvailable ` is set. To avoid this API in the long term, we are
275+ adding the ` v1beta2 ` API described next.
276+
277+ For the ` v1beta2 ` API, the ` DeviceRequest ` object will be restructured
278+ so that there will be the ` Name ` field just like today, and for supporting
279+ either a single request or a prioritized list of subrequests, there will
280+ be separate fields:
281+
282+ * ` Exactly ` for a request of type ` SpecificDeviceRequest ` without alternatives.
283+ ` SpecificDeviceRequest ` will include all the fields that exists on the
284+ ` DeviceRequest ` type in ` v1beta1 ` , except the ` Name ` field.
285+ * ` FirstAvailable ` for providing a prioritized list of requests, each of
286+ type ` DeviceSubRequest ` . The ` DeviceSubRequest ` type is similar to
287+ ` SpecificDeviceRequest ` , except for the ` AdminAccess ` field that is not
288+ available when providing multiple alternatives. The list provided in the
289+ ` FirstAvailable ` field is considered a priority order, such that the
290+ scheduler will only try to use the second item in the list if it is unable
291+ to satisfy the first item, and so on.
288292
289293### User Stories
290294
@@ -621,13 +625,13 @@ type DeviceRequest struct {
621625// is not supported by the client yet, in which case it must refuse to
622626// handle the request.
623627type DeviceSubRequest struct {
624- // Name can be used to reference this subrequest in a pod.spec.containers[].resources.claims
625- // entry and in a constraint of the claim. References must use the
626- // format <parent request>/<subrequest>.
627- //
628- // Must be a DNS label.
629- //
630- // +required
628+ // Name can be used to reference this subrequest in the list of constraints
629+ // or the list of configurations for the claim. References must use the
630+ // format <main request>/<subrequest>.
631+ //
632+ // Must be a DNS label.
633+ //
634+ // +required
631635 Name string ` json:"name" protobuf:"bytes,1,name=name"`
632636
633637 // DeviceClassName references a specific DeviceClass, which can define
@@ -1007,7 +1011,7 @@ they are all local to the control plane.
10071011
10081012The proposed API change relaxes a `required` constraint on the
10091013` DeviceRequest.DeviceClassName` field. The `DeviceRequest` thus becomes a one-of
1010- that must have either the `DeviceClassName` or the `FirstAvailableOf ` field
1014+ that must have either the `DeviceClassName` or the `FirstAvailable ` field
10111015populated.
10121016
10131017Older clients have been advised in the current implementation to check this
@@ -1070,7 +1074,7 @@ This is an add-on on top of the `DynamicResourceAllocation` feature gate, which
10701074also must be enabled for this feature to work.
10711075
10721076- [x] Feature gate (also fill in values in `kep.yaml`)
1073- - Feature gate name : DRAFirstAvailableOf
1077+ - Feature gate name : DRAFirstAvailable
10741078 - Components depending on the feature gate :
10751079 - kube-apiserver
10761080 - kube-scheduler
@@ -1506,7 +1510,7 @@ type ResourceClaimSpec struct {
15061510This is arguably simpler and allows them to be essentially complete, alternate
15071511claims. It would be more difficult for the user, though, as it would require
15081512duplication of other device requests. Additionally, if there were multiple
1509- separate `FirstAvailableOf ` requests in a claim, the user would have to specify
1513+ separate `FirstAvailable ` requests in a claim, the user would have to specify
15101514all the combinations of those in order to get the same flexibility.
15111515
15121516# # Infrastructure Needed (Optional)
0 commit comments