Addon: Kata

Homepage: https://katacontainers.io/
From MicroK8s version: 1.22+
Supported arch: amd64

Kata Containers, is used to build a secure container runtime with lightweight virtual machines that feel and perform like containers, but provide stronger workload isolation using hardware virtualization technology as a second layer of defense. You can enable kata support with:

microk8s enable kata

The addon adds the kata runtimeClassName that allows you to specify what workloads should be started in Kata containers. For instance, the following manifest starts nginx in a Kata container:

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: kata
  name: nginx-kata
spec:
  runtimeClassName: kata
  containers:
    - name: nginx
      image: nginx

By default the addon will install the Kata runtime via the kata-containers snap. Alternatively, you can set the path of the where kata runtime is installed using the --runtime-path argument. The path you provide should include the kata-runtime binary:

microk8s enable kata --runtime-path=/path/to/runtime

On multi-node clusters the microk8s enable kata has to be called on each node so that the kata runtime gets enabled ont the desired nodes.

There is a typo. The example command flag --runtimepath= should be --runtime-path=.

Thank you for spotting this. Fixed.

I noticed another typo. In the last paragraph, microk8s enable addon should be microk8s enable kata.

1 Like

This addon is currently broken and should be removed from the list. The people at Kata are no longer supporting Snap installation and the last available Snap doesn’t work on Ubuntu 22.04. Here’s the warning they put on the Snap:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Warning: This snap is now unmaintained. For further details see Stop packaging a snap · Issue #6769 · kata-containers/kata-containers · GitHub @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

We need to update the addon to have the --runtime-path as a required argument and stop trying to deploy the snap, It should be fairly easy, is anyone interested in giving this a try? This is the file that needs to be edited https://github.com/canonical/microk8s-community-addons/blob/main/addons/kata/enable Thank you

Thanks for the reply! Kata no longer supports Ubuntu which is a huge drag. The only way to install it seems to be through their kata-deploy tool which doesn’t provide automatic updates and, based on what I see in the code below, is broken on Microk8s.

Even if Kata starts supporting Microk8s that’s similar to what they have for k3s, this addon is redundant as the kata-deploy script creates a runtime class which is all this addon does if we no longer have it installing Kata. Thoughts?

So as part of this addon we should submit to the kata project an overlay yaml similar to the ones found in https://github.com/kata-containers/kata-containers/tree/ee57732fe08504773b1b5474f2248834ae1fbd66/tools/packaging/kata-deploy/kata-deploy/overlays and then the addon should just be as easy as downloading and calling kata-deploy.