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
Try fetching the list of pods with restricteduser-context
kubectl --context=restricteduser-context get pods
It will show the following Error: Error from server (Forbidden): pods is forbidden: User "restricteduser" cannot list pods in the namespace "restricted-namespace"
Step 8:
Create a Role and RoleBinding in restricted-namespace
kubectl --context=restricteduser-context run --image nginx:alpine nginx
Step 10:
Using the restricteduser-context, try deleting the pod running
kubectl --context=restricteduser-context get pods
kubectl --context=restricteduser-context delete pod <pod_name>
It will show the following Error: Error from server (Forbidden): pods "nginx-6fc74ccb78-c5ctm" is forbidden: User "restricteduser" cannot delete pods in the namespace "restricted-namespace"
Step 11
To Remove the Role, RoleBinding and the Pod, delete the restricted-namespace.