Context
A PodSecurityPolicy shall prevent the creation of privileged Pods in a specific namespace.
Task
Create a new PodSecurityPolicy named prevent-psp-policy,which prevents the creation of privileged Pods.
Create a new ClusterRole named restrict-access-role, which uses the newly created PodSecurityPolicy prevent-psp-policy.
Create a new ServiceAccount named psp-restrict-sa in the existing namespace staging.
Finally, create a new ClusterRoleBinding named restrict-access-bind, which binds the newly created ClusterRole restrict-access-role to the newly created ServiceAccount psp-restrict-sa.

Suggested Answer: A
Get Premium CKS Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
30 comments · newest first
VI
Viola
11 months ago
I’m surprised we’re still using PodSecurityPolicies, aren’t they deprecated?
DE
Desmond
11 months ago
Wait, does this really apply to all namespaces?
MI
Minna
12 months ago
Totally agree, security first!
LA
Lauran
12 months ago
Sounds good, but are we sure this won't break anything?
BO
Bok
1 year ago
Just created a PodSecurityPolicy to block privileged Pods!
SH
Sharita
1 year ago
I vaguely remember something about ClusterRoleBindings, but I'm not completely confident about how they relate to the ServiceAccount in this context.
JA
Jamal
1 year ago
I feel like I need to double-check how to set the namespace for the ServiceAccount. Was it just a field in the YAML?
TA
Tanesha
1 year ago
I think we did a similar question where we had to create a ClusterRole and bind it to a ServiceAccount. I hope I can recall the steps correctly.
PA
Paul
1 year ago
I remember we practiced creating PodSecurityPolicies, but I'm a bit unsure about the exact syntax for preventing privileged Pods.
DE
Dean
1 year ago
No problem, I've worked with PodSecurityPolicies and RBAC before. I'll create the PodSecurityPolicy first, then the ClusterRole, ServiceAccount, and finally the ClusterRoleBinding. As long as I get the resource names and namespace correct, I should be able to knock this out quickly.
LA
Lamonica
1 year ago
This looks like a tricky one. I'll need to make sure I understand the relationships between the different Kubernetes resources and how they all fit together. Maybe I'll start by sketching out the overall structure before diving into the specific commands.
JE
Jess
1 year ago
Okay, I think I've got a good handle on this. First, I'll create the PodSecurityPolicy to prevent privileged Pods, then the ClusterRole to use that policy. Next, I'll create the ServiceAccount in the staging namespace, and finally, the ClusterRoleBinding to link the ClusterRole and ServiceAccount. Should be straightforward if I follow the steps carefully.
GI
Gilma
1 year ago
Hmm, I'm a bit unsure about the exact syntax for creating these resources. I'll need to review the Kubernetes documentation on PodSecurityPolicies and RBAC to make sure I get the details right.
AH
Ahmad
1 year ago
This looks like a straightforward question on setting up a PodSecurityPolicy and associated RBAC resources. I'll start by creating the PodSecurityPolicy to prevent privileged Pods, then the ClusterRole to use that policy, the ServiceAccount, and finally the ClusterRoleBinding to tie it all together.
PA
Paris
2 years ago
Alright, let's do this! Time to put my Kubernetes skills to the test.
YO
Yolande
2 years ago
Haha, 'prevent-psp-policy' - that's a mouthful! But I'm sure I can remember it.
FR
Freeman
2 years ago
And finally, bind the ClusterRole to the ServiceAccount with the ClusterRoleBinding.
AL
Aleisha
2 years ago
Don't forget to also create the new ClusterRole and ServiceAccount.
DO
Dorthy
2 years ago
Creating the new PodSecurityPolicy is crucial to prevent privileged Pods.
LI
Linn
2 years ago
It is a bit of a mouthful, but it's important for security.
HO
Horace
2 years ago
I agree, creating a PodSecurityPolicy can be tricky.
SA
Sang
2 years ago
I think the task is quite challenging.
RE
Remedios
2 years ago
Wow, this seems like a pretty straightforward task. I'm confident I can nail this one!
CH
Cherelle
2 years ago
If you have any questions, feel free to ask for help.
MA
Madelyn
2 years ago
I'm sure you'll do great, just take it step by step.
JA
Jani
2 years ago
Just follow the steps provided and you'll be fine.
JA
Jame
2 years ago
I agree, it looks like a simple task to complete.
IR
Ira
2 years ago
Gregg: Thanks for the reassurance, I'll get started on it now.
GR
Gregg
2 years ago
User 2: Just follow the steps provided, and you'll be fine.
MA
Marta
2 years ago
I agree, it does seem straightforward.