User-defined Playground

Confidential Containers (CoCo) - Getting Started Playground

A kubeadm cluster (containerd 2.x, Kubernetes 1.37) ready for the Confidential Containers Getting Started guide: label a worker, install CoCo with Helm, inspect the kata-qemu-* RuntimeClasses, and try the kata-qemu-coco-dev workload.

Confidential Containers (CoCo) - Getting Started playground: A kubeadm cluster (containerd 2.x, Kubernetes 1.37) ready for the Confidential Containers Getting Started guide: label a worker, install CoCo with Helm, inspect the kata-qemu-* RuntimeClasses, and try the kata-qemu-coco-dev workload.
Machines & network
3 VMs · 10 vCPU · 16GiB RAM
Playground host Internet NAT MASQUERADE local (bridge) 172.16.0.0/24 gw 172.16.0.1/24eth0eth0eth0
VM
vCPU ·
eth0
/
k8s-omni-dev-machine
VM
vCPU ·
eth0
/
k8s-omni-cplane
VM
vCPU ·
eth0
/
k8s-omni-node
About

About This Playground

A hands-on companion to the Confidential Containers Getting Started guide.

You get a real kubeadm cluster on three VMs:

MachineRole
dev-machineAdmin workstation: kubectl, helm, jq, yq. Files are in ~/coco/.
cplane-01Control plane (untainted, so it can run workloads too)
node-01Worker node, the one you'll label for CoCo

The cluster meets the guide's prerequisites: Kubernetes >= 1.24 (here 1.37), containerd >= 1.7 (here 2.x), Helm >= 3.8, and no SELinux.

Important

There is no hardware TEE, and right now there is no KVM either. iximiuz Labs has temporarily turned off nested virtualization (the Cloud Hypervisor backend) because of a KVM guest-to-host escape vulnerability. Without it, VMs run on Firecracker, which has no /dev/kvm and no /dev/vhost-vsock. CoCo installs fine. The kata-qemu-coco-dev pod in step 5 then fails with host system doesn't support vsock. Seeing why it fails is part of the lesson. Once nested virtualization is back, switch each VM's Backend to Cloud Hypervisor before you start the playground, and the pod should run in a QEMU VM.

1. Check the cluster

From dev-machine:

kubectl get nodes -o wide
ssh node-01 containerd --version

2. Label a worker node

CoCo needs at least one node labeled node.kubernetes.io/worker:

kubectl label node node-01 node.kubernetes.io/worker=

3. Install CoCo with Helm

helm install coco oci://ghcr.io/confidential-containers/charts/confidential-containers \
  --namespace coco-system \
  --create-namespace

kubectl get pods -n coco-system --watch

The kata-as-coco-runtime DaemonSet (kata-deploy) copies Kata into /opt/kata on each node. It also adds the Kata runtime handlers to containerd and restarts containerd. Pulling the image takes about 1-2 minutes. Wait until every pod is Running.

To pin a chart version, add --version <VERSION>. Releases are listed at https://github.com/confidential-containers/charts/releases.

4. Verify the installation

kubectl get runtimeclass
kubectl get node node-01 --show-labels | tr ',' '\n' | grep kata

You should see kata-qemu-coco-dev (for non-TEE testing) next to the TEE classes kata-qemu-snp and kata-qemu-tdx. Look at what kata-deploy put on the node:

ssh node-01 ls /opt/kata/bin
ssh node-01 cat /opt/kata/containerd/config.d/kata-deploy.toml | head -40
ssh node-01 grep -E '^(path|kernel|image|shared_fs|default_memory)' \
  /opt/kata/share/defaults/kata-containers/runtimes/qemu-coco-dev/configuration-qemu-coco-dev.toml

5. Run the simple workload

cat ~/coco/nginx.yaml
kubectl apply -f ~/coco/nginx.yaml
kubectl get pods
kubectl describe pod nginx | sed -n '/Events/,$p'

On Firecracker-backed VMs, the events show:

failed to create shim task: .../configuration-qemu-coco-dev.toml:
host system doesn't support vsock: stat /dev/vhost-vsock: no such file or directory

Check the host capabilities that Kata needs:

~/coco/check-host.sh

With a KVM-capable backend, you'd get nginx 1/1 Running, and kubectl exec nginx -- uname -r would print the guest kernel version, not the node's.

6. Uninstall

kubectl delete -f ~/coco/nginx.yaml
helm uninstall coco --namespace coco-system
kubectl delete namespace coco-system

Further reading

Every playground includes
Learn more about playgrounds
Start
Settings