@@ -1455,29 +1455,8 @@ type DeviceRequest struct {
1455
1455
}
1456
1456
```
1457
1457
1458
- Admin access to devices is a privileged operation because it grants users
1459
- access to devices that are in use by other users. Drivers might also remove
1460
- other restrictions when preparing the device.
1461
-
1462
- In Kubernetes 1.31, an example validating admission policy [ was
1463
- provided] ( https://github.com/kubernetes/kubernetes/blob/4aeaf1e99e82da8334c0d6dddd848a194cd44b4f/test/e2e/dra/test-driver/deploy/example/admin-access-policy.yaml#L1-L11 )
1464
- which restricts access to this option. It is the responsibility of cluster
1465
- admins to ensure that such a policy is installed if the cluster shouldn't allow
1466
- unrestricted access.
1467
-
1468
- Long term, a Kubernetes cluster should disable usage of this field by default
1469
- and only allow it for users with additional privileges. More time is needed to
1470
- figure out how that should work, therefore the field is placed behind a
1471
- separate ` DRAAdminAccess ` feature gate which remains in alpha. A separate
1472
- KEP will be created to push this forward.
1473
-
1474
- The ` DRAAdminAccess ` feature gate controls whether users can set the field to
1475
- true when requesting devices. That is checked in the apiserver. In addition,
1476
- the scheduler refuses to allocate claims with admin access when the feature is
1477
- turned off and somehow the field was set (for example, set in 1.31 when it
1478
- was available unconditionally, or set while the feature gate was enabled).
1479
- A similar check in the kube-controller-manager prevents creating a
1480
- ResourceClaim when the ResourceClaimTemplate has admin access enabled.
1458
+ For more details about ` AdminAccess ` , please refer to [ KEP 5018] ([ KEP
1459
+ #5018 DRA AdminAccess] ( https://kep.k8s.io/5018 ) )
1481
1460
1482
1461
``` yaml
1483
1462
const (
@@ -1870,21 +1849,17 @@ type DeviceRequestAllocationResult struct {
1870
1849
// +required
1871
1850
Device string
1872
1851
1873
- // AdminAccess is a copy of the AdminAccess value in the
1874
- // request which caused this device to be allocated.
1875
- //
1876
- // New allocations are required to have this set when the DRAAdminAccess
1877
- // feature gate is enabled. Old allocations made
1878
- // by Kubernetes 1.31 do not have it yet. Clients which want to
1879
- // support Kubernetes 1.31 need to look up the request and retrieve
1880
- // the value from there if this field is not set.
1852
+ // AdminAccess indicates that this device was allocated for
1853
+ // administrative access. See the corresponding request field
1854
+ // for a definition of mode.
1881
1855
//
1882
1856
// This is an alpha field and requires enabling the DRAAdminAccess
1883
- // feature gate.
1857
+ // feature gate. Admin access is disabled if this field is unset or
1858
+ // set to false, otherwise it is enabled.
1884
1859
//
1885
- // +required
1860
+ // +optional
1886
1861
// +featureGate=DRAAdminAccess
1887
- AdminAccess *bool
1862
+ AdminAccess *bool ` json:"adminAccess" protobuf:"bytes,5,name=adminAccess" `
1888
1863
}
1889
1864
1890
1865
// DeviceAllocationConfiguration gets embedded in an AllocationResult.
@@ -2102,10 +2077,6 @@ per claim is limited to `AllocationResultsMaxSize = 32`. The quota mechanism
2102
2077
uses that as the worst-case upper bound, so ` allocationMode: all ` is treated
2103
2078
like ` allocationMode: exactCount ` with ` count: 32 ` .
2104
2079
2105
- Requests asking for "admin access" contribute to the quota. In practice,
2106
- namespaces where such access is allowed will typically not have quotas
2107
- configured.
2108
-
2109
2080
### kube-controller-manager
2110
2081
2111
2082
The code that creates a ResourceClaim from a ResourceClaimTemplate started
@@ -2784,8 +2755,7 @@ skew are less likely to occur.
2784
2755
2785
2756
### Feature Enablement and Rollback
2786
2757
2787
- The initial answer in this section is for the core DRA. The second answer is
2788
- marked with DRAAdminAccess and applies to that sub-feature.
2758
+ The answer in this section is for the core DRA.
2789
2759
2790
2760
###### How can this feature be enabled / disabled in a live cluster?
2791
2761
@@ -2796,42 +2766,22 @@ marked with DRAAdminAccess and applies to that sub-feature.
2796
2766
- kubelet
2797
2767
- kube-scheduler
2798
2768
- kube-controller-manager
2799
- - [X] Feature gate
2800
- - Feature gate name: DRAAdminAccess
2801
- - Components depending on the feature gate:
2802
- - kube-apiserver
2803
-
2804
-
2805
2769
2806
2770
###### Does enabling the feature change any default behavior?
2807
2771
2808
2772
No.
2809
2773
2810
- DRAAdminAccess: no.
2811
-
2812
2774
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
2813
2775
2814
2776
Yes. Applications that were already deployed and are running will continue to
2815
2777
work, but they will stop working when containers get restarted because those
2816
2778
restarted containers won't have the additional resources.
2817
2779
2818
- DRAAdminAccess: Workloads which were deployed with admin access will continue
2819
- to run with it. They need to be deleted to remove usage of the feature.
2820
- If they were not running, then the feature gate checks in kube-scheduler will prevent
2821
- scheduling and in kube-controller-manager will prevent creating the ResourceClaim from
2822
- a ResourceClaimTemplate. In both cases, usage of the feature is prevented.
2823
-
2824
2780
###### What happens if we reenable the feature if it was previously rolled back?
2825
2781
2826
2782
Pods might have been scheduled without handling resources. Those Pods must be
2827
2783
deleted to ensure that the re-created Pods will get scheduled properly.
2828
2784
2829
- DRAAdminAccess: Workloads which were deployed with admin access enabled are not
2830
- affected by a rollback. If the pods were already running, they keep running. If
2831
- they pods where kept as unschedulable because the scheduler refused to allocate
2832
- claims, they might now get scheduled.
2833
-
2834
-
2835
2785
###### Are there any tests for feature enablement/disablement?
2836
2786
2837
2787
<!--
@@ -2851,9 +2801,6 @@ Tests for apiserver will cover disabling the feature. This primarily matters
2851
2801
for the extended PodSpec: the new fields must be preserved during updates even
2852
2802
when the feature is disabled.
2853
2803
2854
- DRAAdminAccess: Tests for apiserver will cover disabling the feature. A test
2855
- that the DaemonSet controller tolerates keeping pods as pending is needed.
2856
-
2857
2804
### Rollout, Upgrade and Rollback Planning
2858
2805
2859
2806
###### How can a rollout or rollback fail? Can it impact already running workloads?
0 commit comments