@@ -250,28 +250,30 @@ In some cases, an administrator might want to allow users or groups outside the
250
250
administrator group access to create more _privileged pods_. To do so, you can:
251
251
252
252
. Determine the user or group you would like to have access to the SCC.
253
+ +
254
+ [WARNING]
255
+ ====
256
+ Granting access to a user only works when the user directly creates a pod. For
257
+ pods created on behalf of a user, **in most cases** by the system itself, **access
258
+ should be given to a service account** under which related controller is operated
259
+ upon. Examples of resources that create pods on behalf of a user are
260
+ Deployments, StatefulSets, DaemonSets, etc.
261
+ ====
253
262
254
263
. Run:
255
264
+
256
265
----
257
266
$ oc adm policy add-scc-to-user <scc_name> <user_name>
258
267
$ oc adm policy add-scc-to-group <scc_name> <group_name>
259
268
----
260
-
269
+ +
261
270
For example, to allow the *e2e-user* access to the *privileged* SCC, run:
262
-
271
+ +
263
272
----
264
273
$ oc adm policy add-scc-to-user privileged e2e-user
265
274
----
266
275
267
- [WARNING]
268
- ====
269
- Granting access to a user only works when the user directly creates a pod. For
270
- pods created on behalf of a user, in most cases by the system itself, access
271
- should be given to a service account under which related controller is operated
272
- upon. Examples of resources that create pods on behalf of a user are
273
- Deployments, StatefulSets, DaemonSets, etc.
274
- ====
276
+ . Modify `SecurityContext` of a container to request a privileged mode.
275
277
276
278
[[grant-a-service-account-access-to-the-privileged-scc]]
277
279
@@ -295,6 +297,9 @@ account. To do so, set the `spec.serviceAccountName` field to a service account
295
297
name. Leaving the service account name blank will result in the `default`
296
298
service account being used.
297
299
300
+ Then, ensure that at least one of the pod's containers is requesting a
301
+ privileged mode in the security context.
302
+
298
303
[[enable-images-to-run-with-user-in-the-dockerfile]]
299
304
300
305
=== Enable Images to Run with USER in the Dockerfile
0 commit comments