How do Sandboxed Runtimes (gVisor, Kata Containers) differ from standard OCI runc runtimes?
❓ Interview Prompt: Compare gVisor (user-space kernel Sentry), Kata Containers (microVM isolation), and runc (standard namespaces) for multi-tenant security isolation.
Standard containers use Linux namespaces for isolation, but still share the host kernel — one kernel vulnerability exposes all containers. Sandboxed runtimes add an additional isolation layer.
gVisor (Google):
gVisor runs an intercepting user-space kernel called Sentry between the container process and the host kernel.
runtimeClassName: gvisor.Kata Containers:
Kata Containers boot a lightweight microVM (QEMU/Firecracker) per pod — each pod runs inside its own VM with a dedicated kernel.
kata-runtime shim; Kubernetes runtimeClassName: kata-containers.When to Use:
Code Implementation Example
# RuntimeClass definitions — register sandboxed runtimes in Kubernetes
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: gvisor
handler: runsc # gVisor's OCI runtime handler name
---
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: kata-containers
handler: kata-qemu # Kata QEMU microVM handler
---
# Pod selecting gVisor sandbox runtime
apiVersion: v1
kind: Pod
metadata:
name: untrusted-workload
spec:
runtimeClassName: gvisor # or: kata-containers
containers:
- name: app
image: user-submitted-code:latest
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: truegVisor intercepts syscalls via user-space kernel (Sentry); Kata runs each pod in a microVM. Both provide kernel-level isolation beyond standard namespaces — use for untrusted/multi-tenant workloads.