You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 9, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: site/content/docs/concepts/interface-status.md
+74-83Lines changed: 74 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,100 +3,91 @@ title: "Interface Status"
3
3
date: 2025-05-25T11:30:40Z
4
4
---
5
5
6
-
To configure network interfaces in DraNet, users can provide custom configurations through the parameters field of a ResourceClaim or ResourceClaimTemplate. This configuration adheres to the NetworkConfig structure, which defines the desired state for network interfaces and their associated routes.
6
+
### Understanding Interface Status Output
7
7
8
-
### Network Configuration Overview
8
+
When DraNet allocates a network interface to a Pod via a `ResourceClaim`, it publishes the status of the allocated device within the `ResourceClaim`'s `status` field. This provides crucial insights into the readiness and configuration of the network interface from a Kubernetes perspective, adhering to the standardized device status defined in [KEP-4817](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/4817-resource-claim-device-status/README.md).
9
9
10
-
The primary structure for custom network configuration is NetworkConfig. It encompasses settings for the network interface itself and any specific routes to be applied within the Pod's network namespace.
10
+
After a `ResourceClaim` is processed and a network device is allocated, its status is reflected under `ResourceClaim.status.devices`. This section contains `conditions` and `networkData` for each allocated device.
11
11
12
-
```go
13
-
typeNetworkConfigstruct {
14
-
InterfaceInterfaceConfig`json:"interface"`
15
-
Routes []RouteConfig`json:"routes"`
16
-
}
17
-
```
18
-
19
-
#### Interface Configuration
20
-
21
-
The InterfaceConfig structure allows you to specify details for a single network interface.
12
+
#### Conditions
22
13
23
-
```go
24
-
typeInterfaceConfigstruct {
25
-
Namestring`json:"name,omitempty"`
26
-
Addresses []string`json:"addresses,omitempty"`
27
-
MTUint32`json:"mtu,omitempty"`
28
-
HardwareAddrstring`json:"hardwareAddr,omitempty"`
29
-
}
30
-
```
31
-
32
-
***name** (string, optional): The logical name that the interface will have inside the Pod (e.g., "eth0", "enp0s3"). If not specified, DraNet will keep the original name if compliant.
33
-
***addresses** ([]string, optional): A list of IP addresses in CIDR format (e.g., "192.168.1.10/24", "2001:db8::1/64") to be assigned to the interface.
34
-
***mtu** (int32, optional): The Maximum Transmission Unit for the interface.
35
-
***hardwareAddr** (string, optional, Read-Only): The current hardware (MAC) address of the interface.
14
+
The `conditions` array provides a timeline of the device's state and indicates whether specific aspects of its configuration and readiness have been met. DraNet reports the following conditions:
36
15
37
-
#### **Route Configuration (RouteConfig)**
16
+
***`Ready` (type `NetworkDeviceReady`)**: Indicates that the network device has been successfully moved into the Pod's network namespace and is configured.
17
+
***`NetworkReady`**: Signifies that the network interface within the Pod has been successfully configured with its IP addresses and routes.
18
+
***`RDMALinkReady`**: (Applies only when RDMA is used in exclusive mode) Indicates that the associated RDMA link device has been successfully moved into the Pod's network namespace.
38
19
39
-
The RouteConfig structure defines individual network routes to be added to the Pod's network namespace, associated with the configured interface.
20
+
Each condition includes:
21
+
***`lastTransitionTime`**: The timestamp when the condition last changed.
22
+
***`message`**: A human-readable message about the condition.
23
+
***`reason`**: A single-word identifier for the reason for the condition's last transition.
24
+
***`status`**: "True", "False", or "Unknown" indicating the state of the condition.
25
+
***`type`**: The specific type of condition (e.g., "Ready", "NetworkReady").
40
26
41
-
```go
42
-
typeRouteConfigstruct {
43
-
Destinationstring`json:"destination,omitempty"`
44
-
Gatewaystring`json:"gateway,omitempty"`
45
-
Sourcestring`json:"source,omitempty"`
46
-
Scopeuint8`json:"scope,omitempty"`
47
-
}
48
-
```
27
+
#### Network Data (`networkData`)
49
28
50
-
***destination** (string, optional): The destination network in CIDR format (e.g., "0.0.0.0/0" for a default route, "10.0.0.0/8" for a specific subnet).
51
-
***gateway** (string, optional): The IP address of the gateway for the route. This field is mandatory for routes with Universe scope (0).
52
-
***source** (string, optional): An optional source IP address for policy routing.
53
-
***scope** (uint8, optional): The scope of the route. Only Link (253) or Universe (0) are allowed.
54
-
* Link (253): Routes directly to a device without a gateway (e.g., for directly connected subnets).
55
-
* Universe (0): Routes to a network via a gateway.
29
+
The `networkData` field provides standardized output about the network interface as it appears inside the Pod. This data is crucial for applications that need to dynamically discover their assigned network interfaces.
56
30
57
-
### **Example: Customizing a Network Interface and Routes**
31
+
***`interfaceName`**: The actual name of the network interface inside the Pod (e.g., "eth0", "eth99").
32
+
***`hardwareAddress`**: The MAC address of the network interface.
33
+
***`ips`**: A list of IP addresses (in CIDR format) assigned to the interface.
58
34
59
-
Below is an example of a ResourceClaim that allocates a dummy interface, renames it to "eth99", assigns a static IP address, and configures two routes: one to a subnet via a gateway and another link-scoped route.
35
+
### Example Output
60
36
37
+
Here's an example of the `status` section from a `ResourceClaim` named `dummy-interface-static-ip-route`, showing the conditions and network data for an allocated network interface:
0 commit comments