Kata Containers wraps a container in its own lightweight VM. The OCI runtime hands the bundle to Kata, Kata boots a stripped-down VM (QEMU, Firecracker, or Cloud Hypervisor as the VMM), and the container runs inside that VM. From the orchestrator’s perspective it behaves like any other OCI container; from the security perspective it has hypervisor-grade isolation. This is the runtime to reach for when shared-kernel container isolation is not enough.
How to verify
A working Kata install responds to these probes:
kata-runtime --version
kata-runtime check
ls /opt/kata/share/kata-containers/
crictl info | jq .config.runtimes
kubectl get runtimeclass
kata-runtime check is the equivalent of LXC’s checkconfig — it walks every kernel feature and host capability Kata needs (KVM access, vsock support, hugepages availability) and reports OK/missing for each.
What’s happening
A “Kata pod” is actually a microVM running a minimal guest kernel and a guest agent. When containerd or CRI-O receives a CreateContainer request with runtime: kata, it shells out to kata-runtime (the OCI shim). Kata in turn launches QEMU (or Firecracker via kata-fc), with a pre-built guest kernel and a stripped-down rootfs. Inside the VM, kata-agent listens on a vsock channel for further OCI commands (Exec, Start, Kill). The actual container processes run inside this VM with their normal namespaces and cgroups.
From the host’s perspective, there is no container — there is a QEMU process. From the orchestrator’s perspective, there is a normal Kubernetes pod. From the workload’s perspective, it sees its expected container environment. The kernel boundary between the workload and the host is a full hypervisor, not just namespaces.
Two VMM choices matter. QEMU is feature-rich and supports VFIO, hot-plug, and live migration — the slow but flexible option. Firecracker (via kata-fc) is faster and has a smaller attack surface but supports a narrower device set. Pick QEMU for stateful workloads and GPU access; Firecracker for high-density, ephemeral, multi-tenant.
The mental model
kubelet → containerd → kata-runtime shim
│
▼
QEMU / Firecracker
│
┌───────┴───────┐
│ guest VM │
│ guest kernel │
│ kata-agent │
│ workload │
└───────────────┘
The kubelet and containerd see a normal Kubernetes pod. The workload inside sees its expected container environment. Between them is a full Linux kernel and a hypervisor.
Operational notes
- RuntimeClass selection. In Kubernetes, you assign a pod to Kata via
runtimeClassName: kata. Workloads that do not need hypervisor isolation should stay on the defaultrunc— Kata’s overhead is real (50-100 ms boot, 100-200 MiB per pod just for the guest kernel and agent). - Image layers and 9P. The container rootfs is exposed to the guest VM via either
virtio-9p(slow but simple) orvirtiofs(faster but kernel-version-sensitive). For Kata 2.x, usevirtiofswhenever the host kernel supports it. - Hugepages improve boot time. Pre-allocating 2 MiB or 1 GiB hugepages at boot dramatically speeds up VM start.
sysctl -w vm.nr_hugepages=512is a typical baseline on a Kata-host. - Sandbox shared per pod. All containers in a Kubernetes pod share the same Kata sandbox (one VM, multiple containers). This matches the Kubernetes pod model — sibling containers in the pod share network and IPC just as they would with
runc. - VFIO passthrough. With QEMU as VMM, you can pass through physical devices to a Kata container — GPUs, FPGAs, network NICs with SR-IOV. This is the killer feature for GPU workloads that also need isolation.
- Logging. The guest agent forwards stdout/stderr to the host’s containerd log path, so
kubectl logsworks normally. But debugging the VM itself (the guest kernel, agent crashes) requireskata-runtime exec --debug-consoleor attaching to the serial port.
Common pitfalls
- Trying to run Kata on a host without nested virtualisation when itself is a VM. Without
vmx/svmexposed to the host VM, KVM fails to initialise and Kata silently falls back to TCG (emulation mode) which is unusably slow. - Forgetting that Kata pods cannot share the host’s network namespace —
hostNetwork: trueis silently ignored because the pod is in a different VM. Pods that depend on this configuration break in unexpected ways. - Mixing
runcandkatain the same pod — Kubernetes RuntimeClass is per-pod, not per-container. All containers in a pod use the same runtime. - Mounting hostPath volumes into Kata pods without virtiofs configured — the mount succeeds but the I/O is glacial because it falls back to 9P.
- Tuning the guest kernel’s defaults the way you would tune a baremetal host. The guest is short-lived and has different priorities (boot time, memory) than a long-running host.
Stack Harbor uses Kata Containers for clients running multi-tenant Kubernetes where workload-to-host isolation matters — see clustered environments for how we tune the host hugepages, the RuntimeClass policies, and the Firecracker-vs-QEMU choice per workload class.