Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation Exam CKS Topic 4 Question 74 Discussion

Actual exam question for Linux Foundation's CKS exam
Question #: 74
Topic #: 4
[All CKS Questions]

Create a PSP that will only allow the persistentvolumeclaim as the volume type in the namespace restricted.

Create a new PodSecurityPolicy named prevent-volume-policy which prevents the pods which is having different volumes mount apart from persistentvolumeclaim.

Create a new ServiceAccount named psp-sa in the namespace restricted.

Create a new ClusterRole named psp-role, which uses the newly created Pod Security Policy prevent-volume-policy

Create a new ClusterRoleBinding named psp-role-binding, which binds the created ClusterRole psp-role to the created SA psp-sa.

Hint:

Also, Check the Configuration is working or not by trying to Mount a Secret in the pod maifest, it should get failed.

POD Manifest:

apiVersion: v1

kind: Pod

metadata:

name:

spec:

containers:

- name:

image:

volumeMounts:

- name:

mountPath:

volumes:

- name:

secret:

secretName:

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Tricia
2 months ago
I bet the secret volume type will still try to sneak in, like a secret agent in a spy movie. Gotta watch out for that!
upvoted 0 times
Walker
12 days ago
User 3: Yeah, like a secret agent trying to sneak in a secret volume type.
upvoted 0 times
...
Arlen
17 days ago
User 2: Nice, that should prevent any unauthorized volumes from sneaking in.
upvoted 0 times
...
Major
29 days ago
User 1: I set up the PodSecurityPolicy to only allow persistentvolumeclaim as the volume type.
upvoted 0 times
...
...
Timothy
2 months ago
Wait, so I have to create a whole new ServiceAccount, ClusterRole, and ClusterRoleBinding just to restrict the volume type? Seems a bit overkill, but I'll give it a shot.
upvoted 0 times
...
Lorenza
2 months ago
Hold on, does this mean I can't use any other volume types besides persistentVolumeClaim? That could be tricky for some of my applications.
upvoted 0 times
Diane
14 days ago
Make sure to check the logs for any errors when trying to mount a Secret. This restriction may require some adjustments in your application setup.
upvoted 0 times
...
Diane
15 days ago
You can try to mount a Secret in the pod manifest to test if the configuration is working. It should fail since only persistentVolumeClaim is allowed.
upvoted 0 times
...
Diane
1 months ago
Yes, that's correct. The PodSecurityPolicy you created only allows the use of persistentVolumeClaim as the volume type in the restricted namespace.
upvoted 0 times
...
...
Janet
2 months ago
Hmm, creating a PodSecurityPolicy to restrict the volume type seems like a good approach. Let me review the details carefully.
upvoted 0 times
Jacinta
15 days ago
And don't forget to create a ClusterRoleBinding to bind the ClusterRole to the ServiceAccount.
upvoted 0 times
...
Estrella
17 days ago
We also need to create a new ServiceAccount named psp-sa in the restricted namespace.
upvoted 0 times
...
Cherri
29 days ago
Yes, and it should prevent pods from using volumes other than persistentvolumeclaim.
upvoted 0 times
...
Hillary
2 months ago
I think we need to create a new PodSecurityPolicy named prevent-volume-policy.
upvoted 0 times
...
...
Ruthann
3 months ago
The question is clear and the steps are well-defined. I think I can handle this.
upvoted 0 times
Vincent
2 months ago
After that, I will create the ServiceAccount named psp-sa in the restricted namespace.
upvoted 0 times
...
Trinidad
2 months ago
I will start by creating the PodSecurityPolicy named prevent-volume-policy.
upvoted 0 times
...
...
Jenifer
3 months ago
I think we should focus on creating the PodSecurityPolicy first.
upvoted 0 times
...
Van
3 months ago
I agree, we need to carefully follow the instructions.
upvoted 0 times
...
Yuki
3 months ago
This question seems tricky.
upvoted 0 times
...

Save Cancel