@@ -130,14 +130,14 @@ A device, identified by `<driver name>/<pool name>/<device name>` can be
130
130
represented only once in the ` Devices ` slice and will also mention which
131
131
request caused the device to be allocated. The state and characteristics of the
132
132
device are reported in the ` Conditions ` , representing the operational state of
133
- the device and in the ` Info ` , an arbitrary data slice representing device
133
+ the device and in the ` Data ` , an arbitrary data slice representing device
134
134
specific characteristics. Additionally, for networking devices, a field
135
- ` NetworkInfo ` can be used to report the IPs, the MAC address and the
135
+ ` NetworkData ` can be used to report the IPs, the MAC address and the
136
136
interface name.
137
137
138
- ` Info ` being a slice of arbitrary data allows the DRA Driver to store
138
+ ` Data ` being a slice of arbitrary data allows the DRA Driver to store
139
139
device specific data in different formats. For example, a Network Device being
140
- configured by via a CNI plugin could get its ` Info ` filled with the CNI
140
+ configured by via a CNI plugin could get its ` Data ` field filled with the CNI
141
141
result for troubleshooting purpose and with a Network result in a modern
142
142
standard format (closer to Pod.Status.PodIPs for example) used by 3rd party
143
143
controllers.
@@ -161,6 +161,7 @@ type ResourceClaimStatus struct {
161
161
// +listMapKey=driver
162
162
// +listMapKey=device
163
163
// +listMapKey=pool
164
+ // +featureGate=DRAResourceClaimDeviceStatus
164
165
Devices []AllocatedDeviceStatus ` json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"`
165
166
}
166
167
@@ -175,7 +176,7 @@ type AllocatedDeviceStatus struct {
175
176
// vendor of the driver.
176
177
//
177
178
// +required
178
- Driver string ` json:"driver" protobuf:"bytes,2 ,rep,name=driver"`
179
+ Driver string ` json:"driver" protobuf:"bytes,1 ,rep,name=driver"`
179
180
180
181
// This name together with the driver name and the device name field
181
182
// identify which device was allocated (`<driver name>/<pool name>/<device name>`).
@@ -184,56 +185,57 @@ type AllocatedDeviceStatus struct {
184
185
// DNS sub-domains separated by slashes.
185
186
//
186
187
// +required
187
- Pool string ` json:"pool" protobuf:"bytes,3 ,rep,name=pool"`
188
+ Pool string ` json:"pool" protobuf:"bytes,2 ,rep,name=pool"`
188
189
189
190
// Device references one device instance via its name in the driver's
190
191
// resource pool. It must be a DNS label.
191
192
//
192
193
// +required
193
- Device string ` json:"device" protobuf:"bytes,4 ,rep,name=device"`
194
+ Device string ` json:"device" protobuf:"bytes,3 ,rep,name=device"`
194
195
195
196
// Conditions contains the latest observation of the device's state.
196
197
// If the device has been configured according to the class and claim
197
198
// config references, the `Ready` condition should be True.
198
199
//
199
200
// +optional
200
201
// +listType=atomic
201
- Conditions []metav1.Condition ` json:"conditions" protobuf:"bytes,5,rep ,name=conditions"`
202
+ Conditions []metav1.Condition ` json:"conditions" protobuf:"bytes,4,opt ,name=conditions"`
202
203
203
- // Info contains arbitrary driver-specific data.
204
+ // Data contains arbitrary driver-specific data.
204
205
//
205
206
// +optional
206
207
// +listType=atomic
207
- Info []runtime.RawExtension ` json:"info ,omitempty" protobuf:"bytes,6,rep ,name=info "`
208
+ Data []runtime.RawExtension ` json:"data ,omitempty" protobuf:"bytes,5,opt ,name=data "`
208
209
209
- // NetworkInfo contains network-related information specific to the device.
210
+ // NetworkData contains network-related information specific to the device.
210
211
//
211
212
// +optional
212
- // +oneOf=DeviceInfoType
213
- NetworkInfo NetworkDeviceInfo ` json:"networkInfo ,omitempty" protobuf:"bytes,7,rep ,name=networkInfo "`
213
+ // +oneOf=DeviceDataType
214
+ NetworkData NetworkDeviceData ` json:"networkData ,omitempty" protobuf:"bytes,6,opt ,name=networkData "`
214
215
}
215
216
216
- // NetworkDeviceInfo provides network-related details for the allocated device.
217
+ // NetworkDeviceData provides network-related details for the allocated device.
217
218
// This information may be filled by drivers or other components to configure
218
219
// or identify the device within a network context.
219
- type NetworkDeviceInfo struct {
220
+ type NetworkDeviceData struct {
220
221
// InterfaceName specifies the name of the network interface associated with
221
222
// the allocated device. This might be the name of a physical or virtual
222
223
// network interface.
223
224
//
224
225
// +optional
225
- InterfaceName string ` json:"interfaceName,omitempty" protobuf:"bytes,1,rep ,name=interfaceName"`
226
+ InterfaceName string ` json:"interfaceName,omitempty" protobuf:"bytes,1,opt ,name=interfaceName"`
226
227
227
228
// Addresses lists the network addresses assigned to the device's network interface.
228
229
// This can include both IPv4 and IPv6 addresses.
229
230
//
230
231
// +optional
231
- Addresses []NetworkAddress ` json:"addresses,omitempty" protobuf:"bytes,2,rep,name=addresses"`
232
+ // +listType=atomic
233
+ Addresses []NetworkAddress ` json:"addresses,omitempty" protobuf:"bytes,2,opt,name=addresses"`
232
234
233
235
// HWAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
234
236
//
235
237
// +optional
236
- HWAddress string ` json:"hwAddress,omitempty" protobuf:"bytes,3,rep ,name=hwAddress"`
238
+ HWAddress string ` json:"hwAddress,omitempty" protobuf:"bytes,3,opt ,name=hwAddress"`
237
239
}
238
240
239
241
// NetworkAddress provides a network address related details such as IP and Mask.
@@ -272,7 +274,7 @@ assignments or misconfigured network interfaces.
272
274
273
275
### Notes/Constraints/Caveats (Optional)
274
276
275
- The content of ` Info ` is driver specific and not standardized as part of
277
+ The content of ` Data ` is driver specific and not standardized as part of
276
278
DRA, the interpretation of this field may then vary between controllers and
277
279
users reading it.
278
280
@@ -287,7 +289,7 @@ the device they manage. An access control must be set in place to restrict the
287
289
write access to the appropriate driver (A device status can only be updated by
288
290
the entities that have a direct control over the device(s) being reported).
289
291
290
- Adding ` Info ` as an arbitrary data slice may introduce extra processing
292
+ Adding ` Data ` as an arbitrary data slice may introduce extra processing
291
293
and storage overhead which might impact performance in a cluster with many
292
294
devices and frequent status updates. In large-scale clusters where many devices
293
295
are allocated, this impact must be considered.
@@ -398,6 +400,9 @@ to implement this enhancement.
398
400
- The reported device is allocated in the `ResourceClaim`.
399
401
- Properties set in `AllocatedDeviceStatus` are in the correct format.
400
402
403
+ Coverage :
404
+ - `k8s.io/kubernetes/pkg/apis/resource/validation` : ` 9/30/2024` - `77.1`
405
+
401
406
# #### Integration tests
402
407
403
408
- Usage of the `Devices` field in the `ResourceClaimStatus` :
570
575
571
576
# ##### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
572
577
573
- Depending on the content of the `Info ` set by the DRA drivers, the disk
578
+ Depending on the content of the `Data ` set by the DRA drivers, the disk
574
579
usage could increase.
575
580
576
581
# ##### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
@@ -696,7 +701,7 @@ to expose device information and not just the health.
696
701
697
702
### Custom Resources
698
703
699
- In the ` ResourceClaim.Status.Devices ` , instead of having opaque field (` Info ` ) and
704
+ In the ` ResourceClaim.Status.Devices ` , instead of having opaque field (` Data ` ) and
700
705
specific type fields, an object reference could be used for each device. The custom
701
706
object would be created and maintained by the driver to report the status of the
702
707
devices.
0 commit comments