@@ -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,22 +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
1857
// feature gate. Admin access is disabled if this field is unset or
1884
1858
// set to false, otherwise it is enabled.
1885
1859
//
1886
1860
// +optional
1887
1861
// +featureGate=DRAAdminAccess
1888
- AdminAccess *bool
1862
+ AdminAccess *bool ` json:"adminAccess" protobuf:"bytes,5,name=adminAccess" `
1889
1863
}
1890
1864
1891
1865
// DeviceAllocationConfiguration gets embedded in an AllocationResult.
@@ -2103,10 +2077,6 @@ per claim is limited to `AllocationResultsMaxSize = 32`. The quota mechanism
2103
2077
uses that as the worst-case upper bound, so ` allocationMode: all ` is treated
2104
2078
like ` allocationMode: exactCount ` with ` count: 32 ` .
2105
2079
2106
- Requests asking for "admin access" contribute to the quota. In practice,
2107
- namespaces where such access is allowed will typically not have quotas
2108
- configured.
2109
-
2110
2080
### kube-controller-manager
2111
2081
2112
2082
The code that creates a ResourceClaim from a ResourceClaimTemplate started
@@ -2785,8 +2755,7 @@ skew are less likely to occur.
2785
2755
2786
2756
### Feature Enablement and Rollback
2787
2757
2788
- The initial answer in this section is for the core DRA. The second answer is
2789
- marked with DRAAdminAccess and applies to that sub-feature.
2758
+ The answer in this section is for the core DRA.
2790
2759
2791
2760
###### How can this feature be enabled / disabled in a live cluster?
2792
2761
@@ -2797,42 +2766,22 @@ marked with DRAAdminAccess and applies to that sub-feature.
2797
2766
- kubelet
2798
2767
- kube-scheduler
2799
2768
- kube-controller-manager
2800
- - [X] Feature gate
2801
- - Feature gate name: DRAAdminAccess
2802
- - Components depending on the feature gate:
2803
- - kube-apiserver
2804
-
2805
-
2806
2769
2807
2770
###### Does enabling the feature change any default behavior?
2808
2771
2809
2772
No.
2810
2773
2811
- DRAAdminAccess: no.
2812
-
2813
2774
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
2814
2775
2815
2776
Yes. Applications that were already deployed and are running will continue to
2816
2777
work, but they will stop working when containers get restarted because those
2817
2778
restarted containers won't have the additional resources.
2818
2779
2819
- DRAAdminAccess: Workloads which were deployed with admin access will continue
2820
- to run with it. They need to be deleted to remove usage of the feature.
2821
- If they were not running, then the feature gate checks in kube-scheduler will prevent
2822
- scheduling and in kube-controller-manager will prevent creating the ResourceClaim from
2823
- a ResourceClaimTemplate. In both cases, usage of the feature is prevented.
2824
-
2825
2780
###### What happens if we reenable the feature if it was previously rolled back?
2826
2781
2827
2782
Pods might have been scheduled without handling resources. Those Pods must be
2828
2783
deleted to ensure that the re-created Pods will get scheduled properly.
2829
2784
2830
- DRAAdminAccess: Workloads which were deployed with admin access enabled are not
2831
- affected by a rollback. If the pods were already running, they keep running. If
2832
- they pods where kept as unschedulable because the scheduler refused to allocate
2833
- claims, they might now get scheduled.
2834
-
2835
-
2836
2785
###### Are there any tests for feature enablement/disablement?
2837
2786
2838
2787
<!--
@@ -2852,9 +2801,6 @@ Tests for apiserver will cover disabling the feature. This primarily matters
2852
2801
for the extended PodSpec: the new fields must be preserved during updates even
2853
2802
when the feature is disabled.
2854
2803
2855
- DRAAdminAccess: Tests for apiserver will cover disabling the feature. A test
2856
- that the DaemonSet controller tolerates keeping pods as pending is needed.
2857
-
2858
2804
### Rollout, Upgrade and Rollback Planning
2859
2805
2860
2806
###### How can a rollout or rollback fail? Can it impact already running workloads?
0 commit comments