Courseiva

CKS Minimize Microservice Vulnerabilities Practice Question

You need to run a container with a sandboxed runtime using gVisor (runsc). Which Kubernetes resource must be created first to enable this?

⚠ Common exam trap

A common misconception is that runtime selection is done via PodSecurityPolicy or admission webhooks, when in fact it requires a dedicated RuntimeClass resource that maps to a runtime handler configured in the container runtime (e.g., containerd).

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

A RuntimeClass resource with handler: runsc

A RuntimeClass resource is required to define a container runtime configuration that uses gVisor (runsc). When you create a RuntimeClass with handler: runsc, you can then reference it in a Pod spec via the runtimeClassName field, which instructs the kubelet to use the runsc runtime instead of the default runc. This is the foundational step to enable sandboxed runtime isolation for containers.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    A RuntimeClass resource with handler: runsc

    Why this is correct

    A RuntimeClass is a cluster-scoped API object that decouples the pod's runtime requirement from the node's runtime configuration. By defining a RuntimeClass named, for example, 'gvisor' with spec.handler: runsc, and then setting runtimeClassName: gvisor in a pod spec, the kubelet informs the CRI (e.g., containerd) to use the runsc OCI-compatible runtime for that pod's containers. This is the only declarative, supported way to select a sandboxed runtime like gVisor per workload, as the handler string maps directly to a runtime registered in the node's CRI configuration.

  • ✗

    A PodSecurityPolicy that allows the runsc runtime

    Why it's wrong here

    PodSecurityPolicy (PSP) was a deprecated admission controller that enforced security constraints on pod specifications, such as disallowing privileged containers or requiring read-only root filesystems, but it never had any field to select or 'allow' a specific container runtime. Runtime selection is made by the kubelet during pod startup via the RuntimeClass mechanism, which happens after admission and is not part of PSP's policy model. Since PSP was removed in Kubernetes v1.25 and could not control the runtime handler, it is entirely irrelevant to using runsc.

  • ✗

    A ValidatingWebhookConfiguration to validate the runtime

    Why it's wrong here

    A ValidatingWebhookConfiguration is an admission control mechanism that intercepts pod create/update requests and can validate or mutate them via an external webhook server, but it cannot influence how the kubelet launches containers after the pod is admitted. Even if a webhook were to inspect runtimeClassName, it would not cause a sandboxed runtime to be used; the actual runtime resolution happens on the node when the kubelet reads the RuntimeClass object and passes the handler (runsc) to the CRI. There is no requirement for a webhook when using RuntimeClass — creating the RuntimeClass object and referencing it in the pod spec is sufficient.

  • ✗

    A priorityClass with a high priority

    Why it's wrong here

    PriorityClass assigns a numeric priority value to pods, which the scheduler uses to determine scheduling order and preemption when cluster resources are limited. It has absolutely no connection to which OCI runtime executes the pod's containers; the container runtime is determined solely by the runtimeClassName field in the pod spec (or the default runtime if omitted). A pod with a very high priority would still use the default runc-based runtime unless you explicitly set runtimeClassName to a RuntimeClass whose handler is runsc, so this option does nothing to sandbox the workload.

About these practice questions

One of 845 original CKS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.