Skip to main content

Isolate Workloads with the Kata Containers Pack

You can use the Kata Containers pack to run pods inside lightweight virtual machines (VMs) on your Palette-managed clusters. Each pod that runs in Kata Containers gets its own guest kernel and hardware-enforced isolation from the host and from other pods, while you keep the standard Kubernetes workflow. Kata Containers suits multi-tenant clusters and workloads that you do not fully trust. Follow this guide to add the pack to a cluster profile and verify that pods can run in Kata VMs.

How the Pack Works​

The pack installs Kata Containers with the upstream kata-deploy Helm chart. On each node that the pack targets, the installation copies the Kata runtime, hypervisors, and guest images, updates the containerd configuration, and adds the katacontainers.io/kata-runtime=true label. The pack also creates a Kubernetes RuntimeClass named kata-<shim> for each hypervisor shim that it enables.

The Kubernetes Distribution preset determines where the installation finds the containerd configuration on each node.

Pods keep using the default container runtime unless they set runtimeClassName to a Kata RuntimeClass. Kubernetes schedules those pods only on nodes that have the katacontainers.io/kata-runtime=true label.

The shims available on a node depend on its architecture. The following table lists the main RuntimeClasses.

RuntimeClassHypervisor and RuntimeNode Architecture
kata-qemu-runtime-rsQEMU with the Rust runtime. This is the default Kata shim.amd64, arm64
kata-qemuQEMU with the Go runtime.amd64, arm64
kata-clh, kata-clh-runtime-rsCloud Hypervisor with the Go runtime or the Rust runtime.amd64
kata-dragonballDragonball, a hypervisor built into the Rust runtime.amd64

We recommend kata-qemu-runtime-rs unless you have a reason to choose another shim.

Considerations​

  • The pack installs Kata on every node unless you set charts.kata-deploy.nodeSelector to limit it to matching nodes.

  • Installing or updating the pack changes the containerd configuration on each selected node and might restart containerd.

  • By default, the pack uses the job deployment mode, which installs Kata only on the nodes that exist when you install or update the pack. Nodes that join the cluster later do not get Kata until you update the pack. To cover new nodes automatically, change one of the following values:

    • Set charts.kata-deploy.job.reconcile.enabled to true. The pack then checks for new nodes every 15 minutes.

    • Set charts.kata-deploy.deploymentMode to daemonset. The pack then keeps a privileged DaemonSet on every selected node.

  • The pack creates the kata-system namespace with the privileged Pod Security level, because the installation writes to the host.

  • The default values do not enable the NVIDIA GPU passthrough shims.

Prerequisites​

  • A Palette account with permissions to create and manage cluster profiles and clusters. Refer to Roles and Permissions for details.
  • Version 4.4.0 or later of the Kata Containers pack, available in a Palette-registered registry. Refer to Registries for information on adding registries to Palette.
  • A Palette-managed cluster that uses Palette eXtended Kubernetes (PXK), RKE2, or K3s, with Kubernetes 1.29 or later and containerd 1.7 or later. For Edge clusters, use Palette eXtended Kubernetes Edge (PXK-E). If you do not have a cluster yet, refer to Clusters for deployment guides.

  • Nodes that use the amd64 or arm64 architecture and support hardware virtualization through /dev/kvm. Use bare metal nodes, or VMs with nested virtualization enabled. The installation fails on a node that does not expose /dev/kvm.

  • kubectl installed on your workstation.

Create Add-on Cluster Profile​

  1. Log in to Palette.

  2. From the left main menu, select Profiles.

  3. From the Cluster Profiles table, select Add Cluster Profile.

    tip

    If you deployed your cluster with a full cluster profile, you can instead add the Kata Containers pack to a new version of that profile.

  4. Enter a unique Name for the cluster profile and choose a cluster profile Type of Add-on. Select Next.

  5. On the Profile Layers step, select Add New Pack.

  6. Search for kata and select the Kata Containers pack.

  7. Select a Pack Version of 4.4.0 or later.

  8. In the pack Values, expand Presets. Under Kubernetes Distribution, select the preset that matches your cluster.

    Cluster Kubernetes DistributionPreset
    PXK or PXK-EPXK (kubeadm)
    RKE2RKE2
    K3sK3s
  9. Review the remaining pack Values. The default values work for most deployments. Refer to Considerations for the values that control which nodes get Kata.

  10. Select Confirm & Create to return to the Profile Layers page. Select Next.

  11. Review your cluster profile. If the profile needs no changes, select Finish Configuration.

Add Profile to Cluster​

Once you have created the add-on profile, attach it to your cluster. If you added the Kata Containers pack to an existing full profile, update the cluster profile version to the version that includes your changes. Refer to Update a Cluster for more information.

Validate​

Confirm that the nodes can run Kata and that a pod runs inside a Kata VM.

  1. Log in to Palette.

  2. From the left main menu, select Clusters.

  3. Choose your cluster from the Clusters table.

  4. Download the kubeconfig file for your cluster and configure kubectl to use it. Refer to Access Cluster with CLI for guidance.

    export KUBECONFIG=<path-to-kubeconfig>

    Replace <path-to-kubeconfig> with the path to the kubeconfig file that you downloaded.

  5. List the nodes that can run Kata.

    kubectl get nodes --selector katacontainers.io/kata-runtime=true

    Each node where the installation succeeded appears in the output. If a node is missing, confirm that it exposes /dev/kvm. If the node joined the cluster after you installed the pack, refer to Considerations.

  6. List the Kata RuntimeClasses.

    kubectl get runtimeclass

    The output lists a kata-<shim> RuntimeClass for each shim that the pack enabled, such as kata-qemu-runtime-rs.

  7. Deploy a test pod that runs in a Kata VM and prints its kernel version.

    cat << EOF | kubectl apply --filename -
    apiVersion: v1
    kind: Pod
    metadata:
    name: kata-test
    spec:
    runtimeClassName: kata-qemu-runtime-rs
    restartPolicy: Never
    containers:
    - name: test
    image: "busybox:1.37"
    command: ["uname", "--kernel-release"]
    EOF
  8. Wait for the pod to complete.

    kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/kata-test --timeout=120s
    Example Output
    pod/kata-test condition met

    If the command times out, run kubectl describe pod kata-test and review the Events section of the output for the cause.

  9. Compare the kernel version that the pod reports with the kernel versions of the nodes.

    kubectl logs kata-test
    kubectl get nodes --output custom-columns=NAME:.metadata.name,KERNEL:.status.nodeInfo.kernelVersion

    The pod reports a different kernel version from the nodes because it runs on the guest kernel of its Kata VM.

  10. Clean up the test pod.

    kubectl delete pod kata-test

Next Steps​

For the full list of configurable values, refer to the Kata Containers pack. For more information about Kata Containers, including the available hypervisors and their limitations, refer to the Kata Containers documentation.