@@ -213,10 +213,10 @@ the `.spec.nodeName` field and to use a node selector instead.
213
213
214
214
{{< feature-state feature_gate_name="DRAAdminAccess" >}}
215
215
216
- You can mark a request in a ResourceClaim or ResourceClaimTemplate as having privileged features.
217
- A request with admin access grants access to devices which are in use and
218
- may enable additional permissions when making the device available in a
219
- container :
216
+ You can mark a request in a ResourceClaim or ResourceClaimTemplate as having
217
+ privileged features for maintenance and troubleshooting tasks. A request with
218
+ admin access grants access to in-use devices and may enable additional
219
+ permissions when making the device available in a container :
220
220
221
221
` ` ` yaml
222
222
apiVersion: resource.k8s.io/v1beta1
@@ -229,83 +229,19 @@ spec:
229
229
requests:
230
230
- name: req-0
231
231
deviceClassName: resource.example.com
232
+ allocationMode: All
232
233
adminAccess: true
233
234
` ` `
234
235
235
236
If this feature is disabled, the `adminAccess` field will be removed
236
237
automatically when creating such a ResourceClaim.
237
238
238
- Admin access is a privileged mode which should not be made available to normal
239
- users in a multi-tenant cluster. Cluster administrators can restrict usage of
240
- this feature by installing a validating admission policy similar to the following
241
- example. Cluster administrators need to adapt at least the names and replace
242
- " dra.example.com" .
243
-
244
- ` ` ` yaml
245
- # Permission to use admin access is granted only in namespaces which have the
246
- # "admin-access.dra.example.com" label. Other ways of making that decision are
247
- # also possible.
248
-
249
- apiVersion: admissionregistration.k8s.io/v1
250
- kind: ValidatingAdmissionPolicy
251
- metadata:
252
- name: resourceclaim-policy.dra.example.com
253
- spec:
254
- failurePolicy: Fail
255
- matchConstraints:
256
- resourceRules:
257
- - apiGroups: ["resource.k8s.io"]
258
- apiVersions: ["v1alpha3", "v1beta1"]
259
- operations: ["CREATE", "UPDATE"]
260
- resources: ["resourceclaims"]
261
- validations:
262
- - expression: '! object.spec.devices.requests.exists(e, has(e.adminAccess) && e.adminAccess)'
263
- reason: Forbidden
264
- messageExpression: '"admin access to devices not enabled"'
265
- ---
266
- apiVersion: admissionregistration.k8s.io/v1
267
- kind: ValidatingAdmissionPolicyBinding
268
- metadata:
269
- name: resourceclaim-binding.dra.example.com
270
- spec:
271
- policyName: resourceclaim-policy.dra.example.com
272
- validationActions: [Deny]
273
- matchResources:
274
- namespaceSelector:
275
- matchExpressions:
276
- - key: admin-access.dra.example.com
277
- operator: DoesNotExist
278
- ---
279
- apiVersion: admissionregistration.k8s.io/v1
280
- kind: ValidatingAdmissionPolicy
281
- metadata:
282
- name: resourceclaimtemplate-policy.dra.example.com
283
- spec:
284
- failurePolicy: Fail
285
- matchConstraints:
286
- resourceRules:
287
- - apiGroups: ["resource.k8s.io"]
288
- apiVersions: ["v1alpha3", "v1beta1"]
289
- operations: ["CREATE", "UPDATE"]
290
- resources: ["resourceclaimtemplates"]
291
- validations:
292
- - expression: '! object.spec.spec.devices.requests.exists(e, has(e.adminAccess) && e.adminAccess)'
293
- reason: Forbidden
294
- messageExpression: '"admin access to devices not enabled"'
295
- ---
296
- apiVersion: admissionregistration.k8s.io/v1
297
- kind: ValidatingAdmissionPolicyBinding
298
- metadata:
299
- name: resourceclaimtemplate-binding.dra.example.com
300
- spec:
301
- policyName: resourceclaimtemplate-policy.dra.example.com
302
- validationActions: [Deny]
303
- matchResources:
304
- namespaceSelector:
305
- matchExpressions:
306
- - key: admin-access.dra.example.com
307
- operator: DoesNotExist
308
- ` ` `
239
+ Admin access is a privileged mode and should not be granted to regular users in
240
+ multi-tenant clusters. Starting with Kubernetes v1.33, only users authorized to
241
+ create ResourceClaim or ResourceClaimTemplate objects in namespaces labeled with
242
+ `resource.k8s.io/admin-access : " true" ` (case-sensitive) can use the
243
+ ` adminAccess` field. This ensures that non-admin users cannot misuse the
244
+ feature.
309
245
310
246
# # ResourceClaim Device Status
311
247
0 commit comments