Challenge, Easy,  on  KubernetesSecurity

Verify Kernel Isolation Between Kata Containers and runc Using RuntimeClass

Scenario

The cluster has two Kata runtimes available via RuntimeClass:

  • kata-clh — uses Cloud Hypervisor as the VMM
  • kata-qemu — uses QEMU as the VMM

Your task is to deploy Pods using each runtime and prove kernel isolation by comparing the kernel version reported inside each Pod against the runc Pod kernel, saving each output to a file.


Task

Deploy three Pods in the default namespace:

  • nginx-runc — uses the default runc runtime.
  • nginx-clh — uses runtimeClassName: kata-clh
  • nginx-qemu — uses runtimeClassName: kata-qemu

All three Pods should use the image nginx:stable.

After all Pods are Running, run uname -a inside each Pod and save each output to the following paths:

SourceOutput File
nginx-runc/home/laborant/nginx-runc/runc-pod.txt
nginx-clh/home/laborant/nginx-clh/clh-pod.txt
nginx-qemu/home/laborant/nginx-qemu/qemu-pod.txt

Verify that:

  • The nginx-clh and nginx-qemu Pods report a different kernel version from nginx-runc — this is the guest VM kernel bundled with Kata Containers
  • The nginx-clh and nginx-qemu Pods report the same guest kernel version as each other
Hint

A RuntimeClass is a cluster-scoped resource that maps a name to a container runtime handler. Check the available RuntimeClasses before creating Pods:

kubectl get runtimeclass

Reference a RuntimeClass in a Pod spec using the runtimeClassName field:

spec:
  runtimeClassName: kata-clh

If runtimeClassName is omitted, the cluster default runtime (runc) is used.

See the official docs: Runtime Class


Test Cases