8 Scalability for Wasm with Kubernetes

 

This chapter covers

  • Exploring the CRD and operator patterns in Kubernetes
  • Extending Kubernetes to support Wasm workloads
  • Using SpinKube to deploy Spin Wasm apps to Kubernetes
  • Scaling Spin apps with Horizontal Pod Autoscalers
  • Deploying wasmCloud applications to Kubernetes

Wasm has some clear advantages over containers. It’s smaller, which makes it quicker to transfer over the network. It starts up faster. And it's built with a stronger security model. But despite all that, Wasm is still playing catch-up when it comes to the mature tooling and ecosystem that containers enjoy.

In the last chapter, we looked at how to package Wasm applications as container images. Using the OCI image format, we tap into the rich tooling built for containers—most notably, Kubernetes.

Kubernetes is the standard way to manage containers in production. It takes care of scaling, load balancing, service discovery, and more. In this chapter, we’ll look at how Wasm can plug into that same system, and how we can take advantage of the Kubernetes feature set to run and manage Wasm workloads.

8.1 Kubernetes and Wasm

8.2 Running Wasm in Kubernetes with SpinKube

8.2.1 Preparing the cluster for SpinKube

8.2.2 Running a Wasm app in Kubernetes with SpinKube

8.2.3 Scaling Wasm in Kubernetes with SpinKube

8.3 Running Wasm in Kubernetes with wasmCloud

8.3.1 Preparing the cluster for wasmCloud

8.3.2 Running a Wasm app in Kubernetes with wasmCloud

8.4 Running the SmartCMS example on Kubernetes

8.4.1 Preparing the SmartCMS image and manifest

8.4.2 Preparing the Ollama dependency

8.4.3 Running the app

8.5 Summary