Search⌘ K

Build and Configure Kubernetes for Wasm

Explore how to build a 3-node Kubernetes cluster optimized for running WebAssembly applications. Learn to verify containerd Wasm shim configurations, label nodes, and create RuntimeClasses to correctly schedule Wasm workloads in Kubernetes.

In this lesson, we’ll complete the following steps:

  • Build a 3-node Kubernetes cluster (one control plane node and two workers).

  • Inspect the Wasm configuration on one of the worker nodes.

  • Label a worker node so the scheduler knows it can run Wasm apps.

  • Create a RuntimeClass so the scheduler assigns Wasm apps to the node.

Create the cluster

Run the following command to create a new k3d cluster called wasm. Doing this will also change the kubectl context to the new cluster.

Shell
k3d cluster create wasm --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.10.0 -p "5005:80@loadbalancer" --agents 2

The first line creates a new cluster called wasm.

  • The --image flag ...