Skip to main content
This article explains how to instruct Kubernetes Pods to use a specific container runtime implementation (for example, gVisor or Kata Containers) by creating and referencing a RuntimeClass.
A presentation slide titled "Runtime Class in Kubernetes" with a stylized laptop and clock icon on a dark curved background. The left side is mostly white with the title text, while the right side features the dark blue graphic and icon.
Prerequisites
  • A Kubernetes cluster with nodes that have the alternative runtime installed (for example, gVisor’s runsc or Kata Containers’ kata).
  • The node’s container runtime (e.g., containerd) must be configured to expose the runtime handler name that you will reference in the RuntimeClass.
What is a RuntimeClass?
  • RuntimeClass is a cluster-scoped object that allows you to select the container runtime configuration used to run a Pod.
  • It lets you target Pods to a specific runtime handler available on nodes (for example runsc for gVisor).
Key RuntimeClass fields
Ensure the runtime (for example, gVisor / runsc) is installed and configured on every node that may run Pods referring to this RuntimeClass. The handler value must match the runtime name configured in the node’s container runtime (for example, containerd).
Example manifests Below are two manifests you can apply: one for the RuntimeClass itself, and one for a Pod that requests that RuntimeClass. RuntimeClass manifest (save as e.g. gvisor-runtimeclass.yaml):
Pod manifest that uses the RuntimeClass (save as e.g. gvisor-nginx.yaml):
Apply the manifests with kubectl
Verify the RuntimeClass and Pod
  • List available RuntimeClasses:
  • Inspect the Pod spec to confirm it references runtimeClassName: gvisor:
Behavior on the node When a Pod uses a runtime handler such as runsc (gVisor), the container process runs inside the runtime’s sandbox. Because gVisor provides a user-space kernel boundary, the containerized process is isolated from the node kernel and does not appear as a normal host process. Example on the node:
This shows the container is sandboxed (the container runtime process such as runsc is visible, while the container’s internal process is not shown to the host kernel). Links and references

Watch Video

Practice Lab