Kubernetes - RBAC and SecurityWhich of the following is the correct way to label a namespace to enforce the 'restricted' Pod Security Standard in Kubernetes?Akubectl set security namespace myns restrictedBkubectl label pod mypod pod-security.kubernetes.io/enforce=restrictedCkubectl annotate namespace myns pod-security.kubernetes.io/enforce=restrictedDkubectl label namespace myns pod-security.kubernetes.io/enforce=restrictedCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify correct resource and commandPod Security Standards are enforced by labeling namespaces, not pods.Step 2: Check correct syntax for labeling namespaceThe correct command is 'kubectl label namespace pod-security.kubernetes.io/enforce=restricted'.Final Answer:kubectl label namespace myns pod-security.kubernetes.io/enforce=restricted -> Option DQuick Check:Label namespace with enforce=restricted [OK]Quick Trick: Label namespaces, not pods, to enforce Pod Security Standards [OK]Common Mistakes:Labeling pods instead of namespacesUsing annotate instead of labelUsing invalid kubectl commands
Master "RBAC and Security" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes Helm Package Manager - Adding chart repositories - Quiz 6medium Helm Package Manager - Upgrading and rolling back releases - Quiz 12easy Helm Package Manager - Chart templates and values.yaml - Quiz 12easy Helm Package Manager - Installing Helm - Quiz 8hard Operators and Custom Resources - Custom Resource Definitions (CRDs) - Quiz 14medium Production Best Practices - Why production readiness matters - Quiz 12easy Service Mesh - Why service mesh matters - Quiz 12easy Service Mesh - Mutual TLS for service communication - Quiz 13medium Service Mesh - Service mesh vs library-based approach - Quiz 8hard Troubleshooting - Node troubleshooting - Quiz 5medium