Kubernetes in Docker (KinD)

    As prerequisite we need to install KinD first. To do that the and the release page can be used to install the latest version of the KinD CLI.

    If KinD is installed we can directly start with the example from :

    In the rest of this section, we will explain how to create a KinD node image with wasmedge support.

    For the node image we only need the crun binary and not the entire build toolchain. Therefore we use a multistage dockerfile where we create crun in the first step and only copy the crun binary to the node image.

    Now we have a fresh binary with wasmedge enabled under /data/crun/crun that we can copy from this container in the next step.

    Both runc and crun implement the OCI runtime spec and they have the same CLI parametes. Therefore we can just replace the runc binary with our crun-wasmedge binary we created before.

    Now we already have a KinD that uses crun instead of runc. Now we just need two config changes. The first one in the where we add the pod_annotationsthat can be passed to the runtime:

    And the second one to the where we remove a hook that causes some issues.

    The resulting dockerfile looks as follows: