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.
| RuntimeClass | Hypervisor and Runtime | Node Architecture |
|---|---|---|
kata-qemu-runtime-rs | QEMU with the Rust runtime. This is the default Kata shim. | amd64, arm64 |
kata-qemu | QEMU with the Go runtime. | amd64, arm64 |
kata-clh, kata-clh-runtime-rs | Cloud Hypervisor with the Go runtime or the Rust runtime. | amd64 |
kata-dragonball | Dragonball, 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.nodeSelectorto 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
jobdeployment 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.enabledtotrue. The pack then checks for new nodes every 15 minutes. -
Set
charts.kata-deploy.deploymentModetodaemonset. The pack then keeps a privileged DaemonSet on every selected node.
-
-
The pack creates the
kata-systemnamespace with theprivilegedPod 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
-
Log in to Palette.
-
From the left main menu, select Profiles.
-
From the Cluster Profiles table, select Add Cluster Profile.
tipIf you deployed your cluster with a full cluster profile, you can instead add the Kata Containers pack to a new version of that profile.
-
Enter a unique Name for the cluster profile and choose a cluster profile Type of Add-on. Select Next.
-
On the Profile Layers step, select Add New Pack.
-
Search for
kataand select the Kata Containers pack. -
Select a Pack Version of 4.4.0 or later.
-
In the pack Values, expand Presets. Under Kubernetes Distribution, select the preset that matches your cluster.
Cluster Kubernetes Distribution Preset PXK or PXK-E PXK (kubeadm) RKE2 RKE2 K3s K3s -
Review the remaining pack Values. The default values work for most deployments. Refer to Considerations for the values that control which nodes get Kata.
-
Select Confirm & Create to return to the Profile Layers page. Select Next.
-
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.
-
Log in to Palette.
-
From the left main menu, select Clusters.
-
Choose your cluster from the Clusters table.
-
Download the kubeconfig file for your cluster and configure
kubectlto 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. -
List the nodes that can run Kata.
kubectl get nodes --selector katacontainers.io/kata-runtime=trueEach 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. -
List the Kata RuntimeClasses.
kubectl get runtimeclassThe output lists a
kata-<shim>RuntimeClass for each shim that the pack enabled, such askata-qemu-runtime-rs. -
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 -
Wait for the pod to complete.
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/kata-test --timeout=120sExample Outputpod/kata-test condition metIf the command times out, run
kubectl describe pod kata-testand review theEventssection of the output for the cause. -
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.kernelVersionThe pod reports a different kernel version from the nodes because it runs on the guest kernel of its Kata VM.
-
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.