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
-**Advanced Resource Filtering**: Fine-grained filtering of Virtual Functions based on hardware attributes
19
-
-**Custom Resource Definitions**: SriovResourceFilter CRD for configuring device filtering policies
20
-
-**Controller-based Management**: Kubernetes controller pattern for resource filter lifecycle management
18
+
-**Opt-In Device Advertisement**: Devices are only advertised when explicitly defined in a policy
19
+
-**Custom Resource Definitions**:
20
+
- SriovResourcePolicy CRD for configuring device advertisement policies
21
+
- DeviceAttributes CRD defines a set of arbitrary attributes that can be applied to devices selected by a SriovResourcePolicy. Policies reference DeviceAttributes objects via label selectors.
22
+
-**Controller-based Management**: Kubernetes controller pattern for resource policy lifecycle management
21
23
-**Multiple Resource Types**: Support for exposing different VF pools as distinct resource types
22
-
-**Node-targeted Filtering**: Per-node resource filtering with node selector support
24
+
-**Node-targeted Policies**: Per-node resource policies with node selector support
23
25
-**CDI Integration**: Uses Container Device Interface for device injection into containers
24
26
-**NRI Integration**: Node Resource Interface support for advanced container runtime interaction
25
27
-**Kubernetes Native**: Integrates seamlessly with standard Kubernetes resource request/limit model
@@ -79,7 +81,7 @@ The Helm chart supports various configuration options through `values.yaml`:
79
81
-**Image Configuration**: Customize image repository, tag, and pull policy
80
82
-**Resource Limits**: Set resource requests and limits for driver components
81
83
-**Node Selection**: Configure node selectors and tolerations
82
-
-**Namespace Configuration**: Configure the namespace where SriovResourceFilter resources are watched
84
+
-**Namespace Configuration**: Configure the namespace where SriovResourcePolicy resources are watched
83
85
-**Default Interface Prefix**: Set the default interface prefix for virtual functions
84
86
-**CDI Root**: Configure the directory for CDI file generation
85
87
-**Logging**: Adjust log verbosity and format
@@ -137,33 +139,72 @@ spec:
137
139
138
140
## Resource Filtering System
139
141
140
-
The DRA driver includes an advanced resource filtering system that allows administrators to define fine-grained policies for how SR-IOV Virtual Functions are exposed and allocated. This system uses Custom Resource Definitions (CRDs) and a Kubernetes controller to manage device filtering based on hardware characteristics.
142
+
The DRA driver uses an opt-in model where administrators explicitly define which SR-IOV Virtual Functions should be advertised as Kubernetes resources. This system uses Custom Resource Definitions (CRDs) and a Kubernetes controller to manage device advertisement policies based on hardware characteristics.
141
143
142
-
### SriovResourceFilter CRD
144
+
**Important**: Without a matching `SriovResourcePolicy`, no devices will be advertised.
143
145
144
-
The `SriovResourceFilter` custom resource allows you to define filtering policies for SR-IOV devices:
146
+
### SriovResourcePolicy CRD
147
+
148
+
The `SriovResourcePolicy` custom resource defines which SR-IOV devices should be advertised as allocatable resources. Attributes are decoupled into a separate `DeviceAttributes` CRD and linked via label selectors:
145
149
146
150
```yaml
151
+
# 1. Define attributes to apply to matched devices
Each `Config` entry pairs a `deviceAttributesSelector` (label selector matching `DeviceAttributes` objects) with `resourceFilters` (device hardware criteria). Devices matching the filters are advertised, and attributes from all matching `DeviceAttributes` objects are merged onto them.
207
+
167
208
### Filtering Criteria
168
209
169
210
The resource filtering system supports multiple filtering criteria that can be combined:
@@ -173,40 +214,48 @@ The resource filtering system supports multiple filtering criteria that can be c
173
214
- **pciAddresses**: Filter by specific PCI addresses
174
215
- **pfNames**: Filter by Physical Function name (e.g., "eth0", "eth1")
175
216
- **pfPciAddresses**: Filter by Physical Function PCI address
217
+
- **drivers**: Filter by bound driver name (e.g., "vfio-pci", "igb_uio")
176
218
177
219
### Node Selection
178
220
179
-
Use `nodeSelector` to target specific nodes:
221
+
Use `nodeSelector` (a `v1.NodeSelector`) to target specific nodes. Omit it to match all nodes:
180
222
181
223
```yaml
182
224
spec:
183
225
nodeSelector:
184
-
kubernetes.io/hostname: specific-node
185
-
# or
186
-
node-type: sriov-enabled
187
-
# Empty nodeSelector matches all nodes
226
+
nodeSelectorTerms:
227
+
- matchExpressions:
228
+
- key: kubernetes.io/hostname
229
+
operator: In
230
+
values:
231
+
- specific-node
232
+
# Multiple terms are ORed; expressions within a term are ANDed
188
233
```
189
234
190
235
### Multiple Resource Types
191
236
192
-
Define multiple resource configurations to create different pools of Virtual Functions:
237
+
Define multiple configs to create different pools of Virtual Functions, each referencing a `DeviceAttributes` object via label selector:
193
238
194
239
```yaml
195
240
spec:
196
241
configs:
197
-
- resourceName: "high-performance"
242
+
- deviceAttributesSelector:
243
+
matchLabels:
244
+
pool: high-performance
198
245
resourceFilters:
199
246
- vendors: ["8086"]
200
247
pfNames: ["eth0"]
201
-
- resourceName: "standard-networking"
248
+
- deviceAttributesSelector:
249
+
matchLabels:
250
+
pool: standard-networking
202
251
resourceFilters:
203
-
- vendors: ["8086"]
252
+
- vendors: ["8086"]
204
253
pfNames: ["eth1"]
205
254
```
206
255
207
-
### Using Filtered Resources
256
+
### Using Policy-Defined Resources
208
257
209
-
Once a `SriovResourceFilter` is applied, pods can request specific resource types using CEL expressions:
258
+
Once a `SriovResourcePolicy` is applied, devices matching the policy are advertised and pods can request specific resource types using CEL expressions:
210
259
211
260
```yaml
212
261
apiVersion: resource.k8s.io/v1
@@ -299,11 +348,11 @@ Demonstrates requesting multiple Virtual Functions in a single resource claim:
299
348
- VfConfig applies to all allocated VFs in the claim
0 commit comments