Search⌘ K

Build and Prepare the Wasm App

Explore the process of building a WebAssembly app from writing code in Rust, compiling it to a Wasm binary, packaging it into an OCI container image, and preparing it for deployment on a Kubernetes cluster. Learn to create Dockerfiles for minimal Wasm containers and configure the environment to run Wasm workloads on Kubernetes nodes.

We'll cover the following...

In this lesson, we'll write a Wasm app and take it through all the steps required to run it on a Kubernetes cluster.

In the real world, cloud platforms, and other tools will simplify the process, and there are other ways to run Wasm apps on Kubernetes. However, this section gives us a deep understanding of everything involved so we’re ready to deploy and manage Wasm apps on Kubernetes in the real world.

In this and the upcoming lessons, we’ll complete all of the following:

  1. Build a simple web app.

  2. Compile it as a Wasm binary.

  3. Build it into an Open Container Initiative (OCI) image.

  4. Push it to an OCI registry.

  5. Build a multi-node Kubernetes cluster.

  6. Configure the cluster for Wasm.

  7. Deploy the app to Kubernetes.

We’ll need all of the following tools to run the applications.

  1. Docker Desktop 4.27.1 or later

  2. k3d 5.6.0 or later

  3. Rust 1.72 or later with the wasm32-wasi target installed

  4. Spin 2.0 or later ...