RuntimeClass selects a container runtime configuration for a Pod. A class can route a sensitive workload to a stronger sandbox, but the named handler must exist on the selected nodes. A class can also declare scheduling constraints and Pod overhead so the scheduler and quota account for runtime infrastructure outside the application containers. A RuntimeClass object by itself does not install or verify the handler.
RuntimeClass: budget the real cost of a stronger sandbox
Operational decision
A document-unpacking service handles untrusted archives. Install the isolated handler on a labeled node pool through a controlled node-image rollout, then define a RuntimeClass with matching scheduling and measured overhead. The fragment is illustrative configuration; the handler name, node label, and resource numbers must match a tested node pool before use. Launch a canary Pod using the class and unpack a hostile synthetic archive under a CPU and memory load representative of peak requests. Compare startup latency, throughput, memory footprint, and failure handling with the ordinary runtime. Drain a node and confirm a replacement Pod lands only where the handler is available. If the class is missing or the handler fails, the workload should fail visibly instead of silently falling back to the ordinary runtime. Include sandbox overhead in rollout surge capacity and namespace quota; container requests alone understate this placement cost.
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: archive-isolated
handler: archive-isolated
scheduling:
nodeSelector:
platform.example.internal/archive-isolated: "true"
overhead:
podFixed:
cpu: 90m
memory: 118MiCost and verification
A stronger sandbox can reduce host exposure while increasing cold-start time, per-Pod memory, and node-pool cost. It can also narrow eligible placement so a node failure affects more Pods at once. Measure runtime overhead from the actual implementation, rejected or failed Pod starts, eligible-node spare capacity, and unpack throughput. The sample overhead is a planning example, not a benchmark result or a value safe to copy into an arbitrary runtime.
Common Mistakes
- Do not treat a RuntimeClass object as proof that every node has its handler.
- Do not ignore runtime overhead when sizing quota and rollout surge.
- Do not silently fall back to an ordinary runtime when the isolation requirement is mandatory.
Connected lessons
- DevOps: delivery, infrastructure, and reliable operations
- Container runtime restrictions: remove privileges a service does not use
- Kubernetes requests and limits: schedule for real load
- Node autoscaling: make pending Pods schedulable before traffic rises
- Pod Security Admission: stage warnings before a namespace denies Pods
