Skip to content
Blog

Kata Containers and Confidential Container Workloads

A tutorial-style tour of Kata Containers: one lightweight VM per pod, the QEMU/Cloud Hypervisor/Firecracker choices, how it differs from runc and gVisor, and Confidential Containers integration with TDX and SEV-SNP.

Published on • November 15, 2026

AI Assistant

runc gives you a container by creating namespaces and cgroups on the host kernel — fast, light, and one kernel bug away from an escape. Kata Containers takes the opposite bet: every pod boots inside its own lightweight virtual machine, complete with a separate guest kernel, so container isolation inherits hardware virtualization guarantees instead of shared-kernel hygiene. The project (Apache-2.0, ~9.1k stars on GitHub, born from the 2017 merger of Intel’s Clear Containers and Hyper.sh’s runV) now serves as the isolation substrate for Confidential Containers — which makes it the right moment for a hands-on walkthrough of how the pieces fit.

The Architecture: One Lightweight VM per Pod

When containerd receives a pod whose runtime class points at Kata, the flow looks like this:

  1. containerd launches the containerd-shim-kata-v2 process (the shimv2 interface) — one shim per pod sandbox, not per container.
  2. The shim asks the configured hypervisor (QEMU, Cloud Hypervisor, Firecracker, or the built-in Dragonball VMM) to boot a microVM with Kata’s own guest kernel and a minimal rootfs/initrd built by osbuilder.
  3. Inside the VM, kata-agent — a Rust process — starts, and the shim talks to it over virtio-vsock (no TCP networking needed for management).
  4. For each container in the pod, the agent creates namespaces and cgroups inside the guest and runs the workload with the OCI spec it received — so from the workload’s perspective, it is still an ordinary container.
  5. Container root filesystems are shared into the VM via virtio-fs (or 9p), and block devices can be hotplugged over PCI/VDPA for high-throughput storage.

The result: pod-level isolation with a kernel you control (Kata ships its own hardened guest kernel), while the Kubernetes surface — CRI, RuntimeClass, OCI specs — stays unchanged.

Hypervisor Options

Kata’s hypervisor is pluggable, and the choice is a real engineering trade-off:

HypervisorCharacterBest for
QEMUFull-featured, largest attack surface, VFIO/device passthrough, matureLegacy compatibility, device passthrough, x86 feature breadth
Cloud HypervisorRust, rust-vmm based, minimal device model, fast bootGeneral-purpose production default on x86_64
FirecrackerMicroVM purpose-built for serverless (~125 ms boot, ~5 MB floor)Highest density, AWS Lambda-style workloads
DragonballBuilt-in VMM shipped inside the Kata runtime (optional component)Zero-install “it just works” deployments

You can sanity-check the host before deploying anything:

$ kata-runtime check --verbose
INFO: CPU virtualization extensions found
INFO: KVM is available at /dev/kvm
INFO: kernel version 6.8.0 meets minimum requirement

The check validates hardware virtualization (Intel VT-x / AMD SVM on x86_64, ARM Hyp on arm64 — Kata also supports ppc64le and s390x), /dev/kvm access, and kernel requirements.

How It Differs from runc and gVisor

The three isolation tiers are worth holding in your head:

runcgVisorKata
KernelShares host kernelUser-space kernel (Sentry intercepts syscalls; platform ptrace/Gofer for I/O)Separate guest kernel in a VM
Syscall pathDirect to host kernelIntercepted and translated in user spaceHandled by guest, hardware trap to VMM
Isolation strengthNamespace-levelStrong vs. kernel exploits; weaker vs. hardware/VM-level attackersHardware virtualization boundary
Overhead~0Low memory; syscall-heavy workloads slow downTens of MB + boot latency per VM
Device accessFullLimitedVFIO/GPU passthrough via hypervisor

gVisor is the middle answer: cheaper than a VM, and its syscall-interception model blocks a large class of kernel exploits — but it still runs on the host, so a determined attacker targeting the VMM/host boundary or side channels has a shorter path than with Kata’s hardware-enforced split.

Hands-On: Running a Pod on Kata

Install the runtime (packages or the kata-deploy Helm chart), then declare a RuntimeClass:

apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
  name: kata
handler: kata-clh          # kata-qemu, kata-fc, kata-dragonball also exist
overhead:
  podFixed:
    memory: "160Mi"
    cpu: "250m"

Point a pod at it — no other change is required:

apiVersion: v1
kind: Pod
metadata:
  name: untrusted-build
spec:
  runtimeClassName: kata
  containers:
    - name: builder
      image: acme/untrusted-ci-tools:latest
      command: ["sh", "-c", "echo building untrusted PR && sleep 3600"]

overhead matters: declaring the VM’s fixed cost keeps the scheduler honest about real capacity, and you should tune kernel memory, vCPU count, and virtio-fs caching in /etc/kata/configuration.toml for your density target. Expect boot latency in the hundreds of milliseconds and memory overhead of tens of megabytes per pod — the price of the boundary.

Confidential Containers: TDX and SEV-SNP with Kata

Here Kata becomes the vehicle for the guarantees described in the confidential-computing model: the same microVM architecture, but launched into a hardware TEE.

  • Measured, encrypted boot. With a confidential runtime class (CoCo ships kata-qemu-tdx and kata-qemu-sev variants), the VM starts through OVMF/TDVF firmware (TDX) or OVMF/SEV firmware (AMD), the guest kernel and components are measured into the launch digest, and guest memory is encrypted with keys the host cannot use.
  • Attestation inside the pod. An Attestation Agent running in the confidential guest generates a hardware quote (Intel DCAP or AMD SEV-SNP report), and a Key Broker Service in the cluster verifies it against the expected measurements before releasing secrets and image keys.
  • Encrypted images. Container images are pulled encrypted (ocicrypt); only an attested guest receives the decryption key, so the registry, node, and hypervisor never see plaintext layers.
  • Workload stays a pod. Scheduling, RuntimeClass, and CRI are unchanged — the confidential part is entirely below the OCI boundary.
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
  name: kata-qemu-tdx
handler: kata-qemu-tdx

The practical requirements: TDX-capable Xeon or SEV-SNP-capable EPYC nodes, firmware and kernel builds matching your attestation allowlist, and a KBS you trust to enforce it.

When to Choose Kata

Reach for Kata when the workload is untrusted (CI builds of arbitrary pull requests, customer-submitted plugins, multi-tenant SaaS where neighbors are hostile), when compliance demands a verifiable isolation boundary, when you need device passthrough with a clean boundary, or when you are building confidential workloads on TDX/SEV-SNP.

Skip it when density and latency dominate — massive-scale function invocations or latency-critical hot paths where runc’s zero-overhead syscall path wins — or when your threat model is well covered by gVisor’s cheaper syscall interception, or when the host is entirely under your control and SP 800-190-style hygiene suffices.

Kata’s bet is that containers’ speed and VMs’ trust boundary do not have to be a trade — and with Confidential Containers riding on top, that bet is now also how you run pods on infrastructure you do not control.

References