Build and Prepare the Wasm App

Learn how to build and prepare a wasm application and its environment.

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

Getting Kubernetes chapter showed us how to install Docker Desktop and k3d. We’ll build a new k3d cluster in a later step. Go to this link to install Rust.

Once we’ve installed Rust, run the following command to install the wasm32-wasi target so that Rust can compile code to Wasm binaries.

Get hands-on with 1400+ tech skills courses.