Skip to content

Commit f3ae242

Browse files
committed
Fixes based on review
* Typos * Establish a standard instead of laying the foundation for creating a standard * KEP Name * DeviceStatuses keys * AllocatedDeviceStatus request field removed * IPs to a new struct Signed-off-by: Lionel Jouin <[email protected]>
1 parent 56fc9ee commit f3ae242

File tree

2 files changed

+112
-110
lines changed

2 files changed

+112
-110
lines changed

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

Lines changed: 111 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# KEP-4817: Resource Claim Device Status
1+
# KEP-4817: Resource Claim Status With Possible Standardized Network Interface Data
22

33
<!-- toc -->
44
- [Release Signoff Checklist](#release-signoff-checklist)
@@ -75,14 +75,13 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
7575

7676
This proposal enhances the `ResourceClaim.Status` by adding a new field
7777
`DeviceStatuses`. The new field allows drivers to report driver-specific device
78-
status data for each allocated devices in a resource claim. Allowing the
78+
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,
8181
if the IPs of a network device are reported, network services.
8282

83-
This extension also lays the foundation for a potential future standardization
84-
of specific type device data, such as, for example, networking devices
85-
information.
83+
This extension also establishes a standardization for specific type device data,
84+
such as, for example, networking devices information.
8685

8786
## Motivation
8887

@@ -106,8 +105,7 @@ management of resources.
106105

107106
* Allow arbitrary, driver-specific information to be reported from the DRA
108107
drivers for each allocated device in a ResourceClaim.
109-
* Establish a foundation for potential future standardization (e.g. Network
110-
Devices status).
108+
* Establish a standardization for device status (e.g. Network Devices status).
111109
* Enable 3rd party implementation of new functionalities based on the Device
112110
Status (e.g. Secondary Network Services if the IPs of a network device are
113111
reported).
@@ -150,96 +148,100 @@ by using the Kubernetes API.
150148
// ResourceClaimStatus tracks whether the resource has been allocated and what
151149
// the result of that was.
152150
type ResourceClaimStatus struct {
153-
...
154-
155-
// DeviceStatuses contains the status of each device allocated for this
156-
// claim, as reported by the driver. This can include driver-specific
157-
// information. Entries are owned by their respective drivers.
158-
//
159-
// +optional
160-
// +listType=map
161-
// +listMapKey=devicePoolName
162-
// +listMapKey=deviceName
163-
DeviceStatuses []AllocatedDeviceStatus `json:"deviceStatuses,omitempty" protobuf:"bytes,4,opt,name=deviceStatuses"`
151+
...
152+
153+
// DeviceStatuses contains the status of each device allocated for this
154+
// claim, as reported by the driver. This can include driver-specific
155+
// information. Entries are owned by their respective drivers.
156+
//
157+
// +optional
158+
// +listType=map
159+
// +listMapKey=driver
160+
// +listMapKey=device
161+
// +listMapKey=pool
162+
DeviceStatuses []AllocatedDeviceStatus `json:"deviceStatuses,omitempty" protobuf:"bytes,4,opt,name=deviceStatuses"`
164163
}
165164

166165

167166
// AllocatedDeviceStatus contains the status of an allocated device, if the
168167
// driver chooses to report it. This may include driver-specific information.
169168
type AllocatedDeviceStatus struct {
170-
// Request is the name of the request in the claim which caused this
171-
// device to be allocated. Multiple devices may have been allocated
172-
// per request.
173-
//
174-
// +required
175-
Request string `json:"request" protobuf:"bytes,1,rep,name=request"`
176-
177-
// Driver specifies the name of the DRA driver whose kubelet
178-
// plugin should be invoked to process the allocation once the claim is
179-
// needed on a node.
180-
//
181-
// Must be a DNS subdomain and should end with a DNS domain owned by the
182-
// vendor of the driver.
183-
//
184-
// +required
185-
Driver string `json:"driver" protobuf:"bytes,2,rep,name=driver"`
186-
187-
// This name together with the driver name and the device name field
188-
// identify which device was allocated (`<driver name>/<pool name>/<device name>`).
189-
//
190-
// Must not be longer than 253 characters and may contain one or more
191-
// DNS sub-domains separated by slashes.
192-
//
193-
// +required
194-
Pool string `json:"pool" protobuf:"bytes,3,rep,name=pool"`
195-
196-
// Device references one device instance via its name in the driver's
197-
// resource pool. It must be a DNS label.
198-
//
199-
// +required
200-
Device string `json:"device" protobuf:"bytes,4,rep,name=device"`
201-
202-
// Conditions contains the latest observation of the device's state.
203-
// If the device has been configured according to the class and claim
204-
// config references, the `Ready` condition should be True.
205-
//
206-
// +optional
207-
// +listType=atomic
208-
Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,5,rep,name=conditions"`
209-
210-
// DeviceInfo contains Arbitrary driver-specific data.
211-
//
212-
// +optional
213-
// +listType=atomic
214-
DeviceInfo []runtime.RawExtension `json:"deviceInfo,omitempty" protobuf:"bytes,6,rep,name=deviceInfo"`
169+
// Driver specifies the name of the DRA driver whose kubelet
170+
// plugin should be invoked to process the allocation once the claim is
171+
// needed on a node.
172+
//
173+
// Must be a DNS subdomain and should end with a DNS domain owned by the
174+
// vendor of the driver.
175+
//
176+
// +required
177+
Driver string `json:"driver" protobuf:"bytes,2,rep,name=driver"`
178+
179+
// This name together with the driver name and the device name field
180+
// identify which device was allocated (`<driver name>/<pool name>/<device name>`).
181+
//
182+
// Must not be longer than 253 characters and may contain one or more
183+
// DNS sub-domains separated by slashes.
184+
//
185+
// +required
186+
Pool string `json:"pool" protobuf:"bytes,3,rep,name=pool"`
187+
188+
// Device references one device instance via its name in the driver's
189+
// resource pool. It must be a DNS label.
190+
//
191+
// +required
192+
Device string `json:"device" protobuf:"bytes,4,rep,name=device"`
193+
194+
// Conditions contains the latest observation of the device's state.
195+
// If the device has been configured according to the class and claim
196+
// config references, the `Ready` condition should be True.
197+
//
198+
// +optional
199+
// +listType=atomic
200+
Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,5,rep,name=conditions"`
201+
202+
// DeviceInfo contains arbitrary driver-specific data.
203+
//
204+
// +optional
205+
// +listType=atomic
206+
DeviceInfo []runtime.RawExtension `json:"deviceInfo,omitempty" protobuf:"bytes,6,rep,name=deviceInfo"`
215207

216208
// NetworkDeviceInfo contains network-related information specific to the device.
217-
//
218-
// +optional
219-
NetworkDeviceInfo NetworkDeviceInfo `json:"networkDeviceInfo,omitempty" protobuf:"bytes,7,rep,name=networkDeviceInfo"`
209+
//
210+
// +optional
211+
NetworkDeviceInfo NetworkDeviceInfo `json:"networkDeviceInfo,omitempty" protobuf:"bytes,7,rep,name=networkDeviceInfo"`
220212
}
221213

222214
// NetworkDeviceInfo provides network-related details for the allocated device.
223215
// This information may be filled by drivers or other components to configure
224216
// or identify the device within a network context.
225217
type NetworkDeviceInfo struct {
226-
// Interface specifies the name of the network interface associated with
227-
// the allocated device. This might be the name of a physical or virtual
228-
// network interface.
229-
//
230-
// +optional
231-
Interface string `json:"interface,omitempty" protobuf:"bytes,1,rep,name=interface"`
232-
233-
// IPs lists the IP addresses assigned to the device's network interface.
234-
// This can include both IPv4 and IPv6 addresses.
235-
//
236-
// +optional
237-
IPs []string `json:"ips,omitempty" protobuf:"bytes,2,rep,name=ips"`
238-
239-
// Mac represents the MAC address of the device's network interface.
240-
//
241-
// +optional
242-
Mac string `json:"mac,omitempty" protobuf:"bytes,3,rep,name=mac"`
218+
// Interface specifies the name of the network interface associated with
219+
// the allocated device. This might be the name of a physical or virtual
220+
// network interface.
221+
//
222+
// +optional
223+
Interface string `json:"interface,omitempty" protobuf:"bytes,1,rep,name=interface"`
224+
225+
// NetworkAddresses lists the network addresses assigned to the device's network interface.
226+
// This can include both IPv4 and IPv6 addresses.
227+
//
228+
// +optional
229+
NetworkAddresses []NetworkAddress `json:"networkAddresses,omitempty" protobuf:"bytes,2,rep,name=networkAddresses"`
230+
231+
// Mac represents the MAC address of the device's network interface.
232+
//
233+
// +optional
234+
Mac string `json:"mac,omitempty" protobuf:"bytes,3,rep,name=mac"`
235+
}
236+
237+
// NetworkAddress provides a network address related details such as IP and Mask.
238+
type NetworkAddress struct {
239+
// CIDR contains the network address in CIDR notation, which includes
240+
// both the address and the associated subnet mask.
241+
// e.g.: "192.0.2.0/24" for IPv4 and "2001:db8::/64" for IPv6.
242+
//
243+
// +required
244+
CIDR string `json:"cidr,omitempty" protobuf:"bytes,1,rep,name=cidr"`
243245
}
244246
```
245247

@@ -536,15 +538,15 @@ list in a json format in the annotation of the `Pod`.
536538
// NetworkStatus is for network status annotation for pod
537539
// +k8s:deepcopy-gen=false
538540
type NetworkStatus struct {
539-
Name string `json:"name"`
540-
Interface string `json:"interface,omitempty"`
541-
IPs []string `json:"ips,omitempty"`
542-
Mac string `json:"mac,omitempty"`
543-
Mtu int `json:"mtu,omitempty"`
544-
Default bool `json:"default,omitempty"`
545-
DNS DNS `json:"dns,omitempty"`
546-
DeviceInfo *DeviceInfo `json:"device-info,omitempty"`
547-
Gateway []string `json:"gateway,omitempty"`
541+
Name string `json:"name"`
542+
Interface string `json:"interface,omitempty"`
543+
IPs []string `json:"ips,omitempty"`
544+
Mac string `json:"mac,omitempty"`
545+
Mtu int `json:"mtu,omitempty"`
546+
Default bool `json:"default,omitempty"`
547+
DNS DNS `json:"dns,omitempty"`
548+
DeviceInfo *DeviceInfo `json:"device-info,omitempty"`
549+
Gateway []string `json:"gateway,omitempty"`
548550
}
549551
```
550552

@@ -579,23 +581,23 @@ type PodStatus struct {
579581

580582
// NetworkStatus provides the status of specific PodNetwork in a Pod.
581583
type NetworkStatus struct {
582-
// Name is name of PodNetwork
583-
Name string `json:"name"`
584-
585-
// InterfaceName is the network interface name inside the Pod for this attachment.
586-
// Examples: eth1 or net1
587-
//
588-
// +optional
589-
InterfaceName string `json:"interfaceName"`
590-
591-
// ip is an IP address (IPv4 or IPv6) assigned to the pod
592-
IP string `json:"ip,omitempty"`
593-
594-
// IsDefaultGW is a flag indicating that the interface with this IP
595-
// inside the Pod holds the Default Gateway.
596-
//
597-
// +optional
598-
IsDefaultGW bool `json:"isDefaultGW,omitempty"`
584+
// Name is name of PodNetwork
585+
Name string `json:"name"`
586+
587+
// InterfaceName is the network interface name inside the Pod for this attachment.
588+
// Examples: eth1 or net1
589+
//
590+
// +optional
591+
InterfaceName string `json:"interfaceName"`
592+
593+
// ip is an IP address (IPv4 or IPv6) assigned to the pod
594+
IP string `json:"ip,omitempty"`
595+
596+
// IsDefaultGW is a flag indicating that the interface with this IP
597+
// inside the Pod holds the Default Gateway.
598+
//
599+
// +optional
600+
IsDefaultGW bool `json:"isDefaultGW,omitempty"`
599601
}
600602
```
601603

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: Resource Claim Device Status
1+
title: Resource Claim Status With Possible Standardized Network Interface Data
22
kep-number: 4817
33
authors:
44
- "@jane.doe"

0 commit comments

Comments
 (0)