Skip to content

Commit 6bbfb16

Browse files
committed
Rename Info to Data and fix API
1 parent ab1940c commit 6bbfb16

File tree

1 file changed

+27
-22
lines changed
  • keps/sig-node/4817-resource-claim-device-status

1 file changed

+27
-22
lines changed

keps/sig-node/4817-resource-claim-device-status/README.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ A device, identified by `<driver name>/<pool name>/<device name>` can be
130130
represented only once in the `Devices` slice and will also mention which
131131
request caused the device to be allocated. The state and characteristics of the
132132
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
134134
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
136136
interface name.
137137

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
139139
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
141141
result for troubleshooting purpose and with a Network result in a modern
142142
standard format (closer to Pod.Status.PodIPs for example) used by 3rd party
143143
controllers.
@@ -161,6 +161,7 @@ type ResourceClaimStatus struct {
161161
// +listMapKey=driver
162162
// +listMapKey=device
163163
// +listMapKey=pool
164+
// +featureGate=DRAResourceClaimDeviceStatus
164165
Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"`
165166
}
166167

@@ -175,7 +176,7 @@ type AllocatedDeviceStatus struct {
175176
// vendor of the driver.
176177
//
177178
// +required
178-
Driver string `json:"driver" protobuf:"bytes,2,rep,name=driver"`
179+
Driver string `json:"driver" protobuf:"bytes,1,rep,name=driver"`
179180

180181
// This name together with the driver name and the device name field
181182
// identify which device was allocated (`<driver name>/<pool name>/<device name>`).
@@ -184,56 +185,57 @@ type AllocatedDeviceStatus struct {
184185
// DNS sub-domains separated by slashes.
185186
//
186187
// +required
187-
Pool string `json:"pool" protobuf:"bytes,3,rep,name=pool"`
188+
Pool string `json:"pool" protobuf:"bytes,2,rep,name=pool"`
188189

189190
// Device references one device instance via its name in the driver's
190191
// resource pool. It must be a DNS label.
191192
//
192193
// +required
193-
Device string `json:"device" protobuf:"bytes,4,rep,name=device"`
194+
Device string `json:"device" protobuf:"bytes,3,rep,name=device"`
194195

195196
// Conditions contains the latest observation of the device's state.
196197
// If the device has been configured according to the class and claim
197198
// config references, the `Ready` condition should be True.
198199
//
199200
// +optional
200201
// +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"`
202203

203-
// Info contains arbitrary driver-specific data.
204+
// Data contains arbitrary driver-specific data.
204205
//
205206
// +optional
206207
// +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"`
208209

209-
// NetworkInfo contains network-related information specific to the device.
210+
// NetworkData contains network-related information specific to the device.
210211
//
211212
// +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"`
214215
}
215216

216-
// NetworkDeviceInfo provides network-related details for the allocated device.
217+
// NetworkDeviceData provides network-related details for the allocated device.
217218
// This information may be filled by drivers or other components to configure
218219
// or identify the device within a network context.
219-
type NetworkDeviceInfo struct {
220+
type NetworkDeviceData struct {
220221
// InterfaceName specifies the name of the network interface associated with
221222
// the allocated device. This might be the name of a physical or virtual
222223
// network interface.
223224
//
224225
// +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"`
226227

227228
// Addresses lists the network addresses assigned to the device's network interface.
228229
// This can include both IPv4 and IPv6 addresses.
229230
//
230231
// +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"`
232234

233235
// HWAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
234236
//
235237
// +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"`
237239
}
238240

239241
// NetworkAddress provides a network address related details such as IP and Mask.
@@ -272,7 +274,7 @@ assignments or misconfigured network interfaces.
272274

273275
### Notes/Constraints/Caveats (Optional)
274276

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
276278
DRA, the interpretation of this field may then vary between controllers and
277279
users reading it.
278280

@@ -287,7 +289,7 @@ the device they manage. An access control must be set in place to restrict the
287289
write access to the appropriate driver (A device status can only be updated by
288290
the entities that have a direct control over the device(s) being reported).
289291

290-
Adding `Info` as an arbitrary data slice may introduce extra processing
292+
Adding `Data` as an arbitrary data slice may introduce extra processing
291293
and storage overhead which might impact performance in a cluster with many
292294
devices and frequent status updates. In large-scale clusters where many devices
293295
are allocated, this impact must be considered.
@@ -398,6 +400,9 @@ to implement this enhancement.
398400
- The reported device is allocated in the `ResourceClaim`.
399401
- Properties set in `AllocatedDeviceStatus` are in the correct format.
400402

403+
Coverage:
404+
- `k8s.io/kubernetes/pkg/apis/resource/validation`: `9/30/2024` - `77.1`
405+
401406
##### Integration tests
402407

403408
- Usage of the `Devices` field in the `ResourceClaimStatus`:
@@ -570,7 +575,7 @@ No
570575

571576
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
572577

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
574579
usage could increase.
575580

576581
###### 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.
696701

697702
### Custom Resources
698703

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
700705
specific type fields, an object reference could be used for each device. The custom
701706
object would be created and maintained by the driver to report the status of the
702707
devices.

0 commit comments

Comments
 (0)