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
$ kubectl-user auth can-i use podsecuritypolicy/example
248
+
249
+
kubectl-user auth can-i use podsecuritypolicy/example
246
250
yes
247
251
```
248
252
249
253
Now retry creating the pod:
250
254
251
255
```shell
252
-
$ kubectl-user create -f- <<EOF
256
+
kubectl-user create -f- <<EOF
253
257
apiVersion: v1
254
258
kind: Pod
255
259
metadata:
@@ -266,7 +270,7 @@ It works as expected! But any attempts to create a privileged pod should still
266
270
be denied:
267
271
268
272
```shell
269
-
$ kubectl-user create -f- <<EOF
273
+
kubectl-user create -f- <<EOF
270
274
apiVersion: v1
271
275
kind: Pod
272
276
metadata:
@@ -284,19 +288,21 @@ Error from server (Forbidden): error when creating "STDIN": pods "privileged" is
284
288
Delete the pod before moving on:
285
289
286
290
```shell
287
-
$ kubectl-user delete pod pause
291
+
kubectl-user delete pod pause
288
292
```
289
293
290
294
### Run another pod
291
295
292
296
Let's try that again, slightly differently:
293
297
294
298
```shell
295
-
$ kubectl-user run pause --image=k8s.gcr.io/pause
299
+
kubectl-user run pause --image=k8s.gcr.io/pause
296
300
deployment "pause" created
297
-
$ kubectl-user get pods
301
+
302
+
kubectl-user get pods
298
303
No resources found.
299
-
$ kubectl-user get events | head -n 2
304
+
305
+
kubectl-user get events | head -n 2
300
306
LASTSEEN FIRSTSEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
301
307
1m 2m 15 pause-7774d79b5 ReplicaSet Warning FailedCreate replicaset-controller Error creating: pods "pause-7774d79b5-" is forbidden: no providers available to validate pod request
302
308
```
@@ -314,7 +320,7 @@ account instead. In this case (since we didn't specify it) the service account
0 commit comments