Skip to content

Commit 75b0c94

Browse files
committed
Fixes based on review
Signed-off-by: Lionel Jouin <[email protected]>
1 parent f3ae242 commit 75b0c94

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

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

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
7474
## Summary
7575

7676
This proposal enhances the `ResourceClaim.Status` by adding a new field
77-
`DeviceStatuses`. The new field allows drivers to report driver-specific device
77+
`Devices`. The new field allows drivers to report driver-specific device
7878
status data for each allocated device in a resource claim. Allowing the
7979
drivers to report the device statuses will improve both observability and
8080
troubleshooting as well as enabling new functionalities such as, for example,
@@ -120,28 +120,28 @@ reported).
120120

121121
### API - ResourceClaim.Status
122122

123-
The API changes define a new `DeviceStatuses` field in the existing
124-
`ResourceClaimStatus` struct. `DeviceStatuses` is a slice of a new struct
123+
The API changes define a new `Devices` field in the existing
124+
`ResourceClaimStatus` struct. `Devices` is a slice of a new struct
125125
`AllocatedDeviceStatus` which holds device specific information.
126126

127127
A device, identified by `<driver name>/<pool name>/<device name>` can be
128-
represented only once in the `DeviceStatuses` slice and will also mention which
128+
represented only once in the `Devices` slice and will also mention which
129129
request caused the device to be allocated. The state and characteristics of the
130130
device are reported in the `Conditions`, representing the operational state of
131-
the device and in the `DeviceInfo`, an arbitrary data slice representing device
131+
the device and in the `Info`, an arbitrary data slice representing device
132132
specific characteristics. Additionally, for networking devices, a field
133-
`NetworkDeviceInfo` can be used to report the IPs, the MAC address and the
133+
`NetworkInfo` can be used to report the IPs, the MAC address and the
134134
interface name.
135135

136-
`DeviceInfo` being a slice of arbitrary data allows the DRA Driver to store
136+
`Info` being a slice of arbitrary data allows the DRA Driver to store
137137
device specific data in different formats. For example, a Network Device being
138-
configured by via a CNI plugin could get its `DeviceInfo` filled with the CNI
138+
configured by via a CNI plugin could get its `Info` filled with the CNI
139139
result for troubleshooting purpose and with a Network result in a modern
140140
standard format (closer to Pod.Status.PodIPs for example) used by 3rd party
141141
controllers.
142142

143143
For each device, if required, the DRA Driver processing the device allocation
144-
can report the status of it in the `Status.DeviceStatuses` of the ResourceClaim
144+
can report the status of it in the `Status.Devices` of the ResourceClaim
145145
by using the Kubernetes API.
146146

147147
```golang
@@ -150,7 +150,7 @@ by using the Kubernetes API.
150150
type ResourceClaimStatus struct {
151151
...
152152

153-
// DeviceStatuses contains the status of each device allocated for this
153+
// Devices contains the status of each device allocated for this
154154
// claim, as reported by the driver. This can include driver-specific
155155
// information. Entries are owned by their respective drivers.
156156
//
@@ -159,10 +159,9 @@ type ResourceClaimStatus struct {
159159
// +listMapKey=driver
160160
// +listMapKey=device
161161
// +listMapKey=pool
162-
DeviceStatuses []AllocatedDeviceStatus `json:"deviceStatuses,omitempty" protobuf:"bytes,4,opt,name=deviceStatuses"`
162+
Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"`
163163
}
164164

165-
166165
// AllocatedDeviceStatus contains the status of an allocated device, if the
167166
// driver chooses to report it. This may include driver-specific information.
168167
type AllocatedDeviceStatus struct {
@@ -199,39 +198,40 @@ type AllocatedDeviceStatus struct {
199198
// +listType=atomic
200199
Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,5,rep,name=conditions"`
201200

202-
// DeviceInfo contains arbitrary driver-specific data.
201+
// Info contains arbitrary driver-specific data.
203202
//
204203
// +optional
205204
// +listType=atomic
206-
DeviceInfo []runtime.RawExtension `json:"deviceInfo,omitempty" protobuf:"bytes,6,rep,name=deviceInfo"`
205+
Info []runtime.RawExtension `json:"info,omitempty" protobuf:"bytes,6,rep,name=info"`
207206

208-
// NetworkDeviceInfo contains network-related information specific to the device.
207+
// NetworkInfo contains network-related information specific to the device.
209208
//
210209
// +optional
211-
NetworkDeviceInfo NetworkDeviceInfo `json:"networkDeviceInfo,omitempty" protobuf:"bytes,7,rep,name=networkDeviceInfo"`
210+
// +oneOf=DeviceInfoType
211+
NetworkInfo NetworkDeviceInfo `json:"networkInfo,omitempty" protobuf:"bytes,7,rep,name=networkInfo"`
212212
}
213213

214214
// NetworkDeviceInfo provides network-related details for the allocated device.
215215
// This information may be filled by drivers or other components to configure
216216
// or identify the device within a network context.
217217
type NetworkDeviceInfo struct {
218-
// Interface specifies the name of the network interface associated with
218+
// InterfaceName specifies the name of the network interface associated with
219219
// the allocated device. This might be the name of a physical or virtual
220220
// network interface.
221221
//
222222
// +optional
223-
Interface string `json:"interface,omitempty" protobuf:"bytes,1,rep,name=interface"`
223+
InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,rep,name=interfaceName"`
224224

225-
// NetworkAddresses lists the network addresses assigned to the device's network interface.
225+
// Addresses lists the network addresses assigned to the device's network interface.
226226
// This can include both IPv4 and IPv6 addresses.
227227
//
228228
// +optional
229-
NetworkAddresses []NetworkAddress `json:"networkAddresses,omitempty" protobuf:"bytes,2,rep,name=networkAddresses"`
229+
Addresses []NetworkAddress `json:"addresses,omitempty" protobuf:"bytes,2,rep,name=addresses"`
230230

231-
// Mac represents the MAC address of the device's network interface.
231+
// HWAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
232232
//
233233
// +optional
234-
Mac string `json:"mac,omitempty" protobuf:"bytes,3,rep,name=mac"`
234+
HWAddress string `json:"hwAddress,omitempty" protobuf:"bytes,3,rep,name=hwAddress"`
235235
}
236236

237237
// NetworkAddress provides a network address related details such as IP and Mask.
@@ -262,15 +262,15 @@ them.
262262

263263
As a Network Administrator, troubleshooting networking issues can be complex
264264
and time consuming especially when the device characteristics and operational
265-
status are not readily accessible. The `DeviceStatuses` field in the
265+
status are not readily accessible. The `Devices` field in the
266266
`ResourceClaim.Status` provides access to comprehensive details regarding
267267
network interfaces helping to quickly and efficiently identify the issues such
268268
as error messages on failed network interface configuration, incorrect IP
269269
assignments or misconfigured network interfaces.
270270

271271
### Notes/Constraints/Caveats (Optional)
272272

273-
The content of `DeviceInfo` is driver specific and not standardized as part of
273+
The content of `Info` is driver specific and not standardized as part of
274274
DRA, the interpretation of this field may then vary between controllers and
275275
users reading it.
276276

@@ -280,12 +280,12 @@ changes of the state of the device.
280280

281281
### Risks and Mitigations
282282

283-
As stated, 3rd party DRA drivers will set and update the `DeviceStatuses` for
283+
As stated, 3rd party DRA drivers will set and update the `Devices` for
284284
the device they manage. An access control must be set in place to restrict the
285285
write access to the appropriate driver (A device status can only be updated by
286286
the driver which allocated and configured this device).
287287

288-
Adding `DeviceInfo` as an arbitrary data slice may introduce extra processing
288+
Adding `Info` as an arbitrary data slice may introduce extra processing
289289
and storage overhead which might impact performance in a cluster with many
290290
devices and frequent status updates. In large-scale clusters where many devices
291291
are allocated, this impact must be considered.
@@ -295,7 +295,7 @@ are allocated, this impact must be considered.
295295
### API
296296

297297
The `ResourceClaimStatus` struct in `pkg/apis/resource/types.go` will be
298-
extended to include the slice of `DeviceStatuses`.
298+
extended to include the slice of `Devices`.
299299

300300
`ResourceClaim` validation of the status in
301301
`pkg/apis/resource/validation/validation.go` will be covered to allow a device
@@ -319,7 +319,7 @@ to implement this enhancement.
319319

320320
##### Integration tests
321321

322-
- Usage of the `DeviceStatuses` field in the `ResourceClaimStatus`:
322+
- Usage of the `Devices` field in the `ResourceClaimStatus`:
323323
* With the feature gate enabled, the field exists in the `ResourceClaim`.
324324
* With the feature gate disabled, the field does not exist in the
325325
`ResourceClaim`.
@@ -332,7 +332,7 @@ TBD
332332

333333
#### Alpha
334334

335-
- Feature implemented behind feature gates (`ResourceClaimDeviceStatus`).
335+
- Feature implemented behind feature gates (`DRAResourceClaimDeviceStatus`).
336336
Feature Gates are disabled by default.
337337
- Documentation provided.
338338
- Initial unit, integration and e2e tests completed and enabled.
@@ -371,7 +371,7 @@ skew with other Kubernetes components.
371371
###### How can this feature be enabled / disabled in a live cluster?
372372

373373
- [x] Feature gate (also fill in values in `kep.yaml`)
374-
- Feature gate name: ResourceClaimDeviceStatus
374+
- Feature gate name: DRAResourceClaimDeviceStatus
375375
- Components depending on the feature gate: kube-apiserver
376376
- [ ] Other
377377
- Describe the mechanism:
@@ -421,15 +421,15 @@ No
421421

422422
###### How can an operator determine if the feature is in use by workloads?
423423

424-
Check the `ResourceClaim.Status.DeviceStatuses`.
424+
Check the `ResourceClaim.Status.Devices`.
425425

426426
###### How can someone using this feature know that it is working for their instance?
427427

428428
- [ ] Events
429429
- Event Reason:
430430
- [x] API .status
431431
- Condition name:
432-
- Other field: `ResourceClaim.Status.DeviceStatuses`
432+
- Other field: `ResourceClaim.Status.Devices`
433433
- [ ] Other (treat as last resort)
434434
- Details:
435435

@@ -487,7 +487,7 @@ No
487487

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

490-
Depending on the content of the `DeviceInfo` set by the DRA drivers, the disk
490+
Depending on the content of the `Info` set by the DRA drivers, the disk
491491
usage could increase.
492492

493493
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?

keps/sig-node/4817-resource-claim-device-status/kep.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ reviewers:
1515
- "@MikeZappa87"
1616
- "@s1061123"
1717
approvers:
18-
- TBD
18+
- "@aojea"
19+
- "@thockin"
20+
- "@johnbelamaric"
1921

2022
see-also:
2123
- "/keps/sig-node/3063-dynamic-resource-allocation"
@@ -34,7 +36,7 @@ milestone:
3436
# The following PRR answers are required at alpha release
3537
# List the feature gate name and the components for which it must be enabled
3638
feature-gates:
37-
- name: ResourceClaimDeviceStatus
39+
- name: DRAResourceClaimDeviceStatus
3840
components:
3941
- kube-apiserver
4042
disable-supported: true

0 commit comments

Comments
 (0)