Bird
0
0

You want to enforce the 'restricted' Pod Security Standard on a namespace but allow pods to use a specific hostPath volume for logging. How can you achieve this?

hard📝 Workflow Q8 of 15
Kubernetes - RBAC and Security
You want to enforce the 'restricted' Pod Security Standard on a namespace but allow pods to use a specific hostPath volume for logging. How can you achieve this?
ALabel the namespace with 'restricted' and create an exception using a Pod Security Admission webhook
BSet the namespace label to 'baseline' to allow hostPath volumes
CRemove Pod Security Standards enforcement and rely on manual audits
DUse a privileged Pod Security Standard to allow all hostPath volumes
Step-by-Step Solution
Solution:
  1. Step 1: Understand restricted policy and exceptions

    Restricted forbids hostPath volumes, but exceptions can be made via admission webhooks.
  2. Step 2: Apply restricted label with exception

    Label namespace as restricted and configure a Pod Security Admission webhook to allow specific hostPath usage.
  3. Final Answer:

    Label the namespace with 'restricted' and create an exception using a Pod Security Admission webhook -> Option A
  4. Quick Check:

    Restricted + webhook exception = allow specific hostPath [OK]
Quick Trick: Use admission webhook for exceptions in restricted policy [OK]
Common Mistakes:
  • Downgrading to baseline to allow hostPath
  • Disabling enforcement instead of exceptions
  • Using privileged policy unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes