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
Copy file name to clipboardExpand all lines: README.md
+50-1Lines changed: 50 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -348,10 +348,58 @@ You can use the IDs of the GPUs as well as the GPU sharing settings set in
348
348
these environment variables to verify that they were handed out in a way
349
349
consistent with the semantics shown in the figure above.
350
350
351
+
### Demo DRA Admin Access Feature
352
+
This example driver includes support for the [DRA AdminAccess feature](https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#admin-access), which allows administrators to gain privileged access to devices already in use by other users. This example demonstrates the end-to-end flow by setting the `DRA_ADMIN_ACCESS` environment variable. A driver managing real devices could use this to expose host hardware information.
353
+
354
+
#### Usage Example
355
+
356
+
See `demo/gpu-test7.yaml` for a complete example. Key points:
357
+
358
+
1.**Namespace**: Must have the `resource.kubernetes.io/admin-access` label set to create ResourceClaimTemplate and ResourceClaim with `adminAccess: true` for Kubernetes v1.34+.
359
+
```yaml
360
+
apiVersion: v1
361
+
kind: Namespace
362
+
metadata:
363
+
name: gpu-test7
364
+
labels:
365
+
resource.kubernetes.io/admin-access: "true"
366
+
```
367
+
368
+
2. **Resource Claim Template**: Request must have `adminAccess: true`. The `allocationMode: All` is used to demonstrate accessing all available devices with admin privileges.
369
+
```yaml
370
+
spec:
371
+
spec:
372
+
devices:
373
+
requests:
374
+
- name: admin-gpu
375
+
exactly:
376
+
deviceClassName: gpu.example.com
377
+
allocationMode: All
378
+
adminAccess: true
379
+
```
380
+
381
+
3. **Container**: Will receive elevated privileges from the driver, represented here as environment variables
382
+
```bash
383
+
echo "DRA Admin Access: $DRA_ADMIN_ACCESS"
384
+
# Output examples:
385
+
# DRA Admin Access: true
386
+
```
387
+
388
+
#### Testing
389
+
390
+
To run this demo:
391
+
```bash
392
+
./demo/test-admin-access.sh
393
+
```
394
+
395
+
This demonstration shows the end-to-end flow of the DRA AdminAccess feature. In a production environment, drivers could use this admin access indication to provide additional privileged capabilities or information to authorized workloads.
396
+
397
+
### Clean Up
398
+
351
399
Once you have verified everything is running correctly, delete all of the
0 commit comments