Kubernetes Runtime Classes

RuntimeClass lets you select the container runtime for individual pods. Different workloads have different security and performance requirements — high-security workloads can use kernel-isolated runtimes like gVisor or kata-containers while standard workloads continue using containerd with runc. RuntimeClass makes this selection explicit in the pod spec rather than requiring node selector hacks.

Overview

Overview

RuntimeClass is the Kubernetes primitive that exposes the security/performance knob for container isolation. It lets each workload make a different isolation choice without changing the deployment interface.

The choice is one field. A Pod spec names a class in runtimeClassName, and the RuntimeClass decides which runtime starts the pod. In practice there are three common answers. The default is runc, which runs the container on the shared host kernel. A sandboxed class uses gVisor, which puts a user-space kernel between the container and the host. A class with a VM boundary uses kata-containers, which runs the pod inside a lightweight VM.

> [!NOTE] Most clusters run everything with runc because it is fast and well understood, but one-size-fits-all is increasingly inadequate for sensitive workloads.

Key concepts

  • containerd Shim Architecture

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio