A Spin application packages WebAssembly components for execution by the Spin framework and runtime. For Kubernetes deployment, it is built, published to an OCI registry image, and represented by a SpinApp custom resource that SpinKube can deploy and manage through Kubernetes-native patterns. section 8.2.2 section 8.5
A practical deployment pipeline is:
- Build the application with spin build. section 8.2.2
- Push the resulting application as an OCI image to a registry. section 8.2.2
- Use the Spin kube plugin to scaffold a SpinApp manifest, then apply it to the cluster. section 8.2.2
- Expose or test the deployed service with Kubernetes tooling such as port forwarding and curl. section 8.2.2
HTTP application scaled by demand
A JavaScript HTTP application can provide ordinary routes plus a deliberately expensive /load route that calculates Fibonacci values. Publishing it and scaffolding with HPA settings creates a SpinApp with CPU and memory requests, limits, and one-to-ten replicas; sustained load lets Kubernetes increase replicas. section 8.2.3
Spin applications let Wasm workloads reuse Kubernetes orchestration, service discovery, load balancing, and autoscaling while relying on SpinKube’s CRDs and operator. This bridges gaps where a Wasm-native operational tool is not available, though it requires the specialized containerd-shim-spin executor. section 8.5 section 8.2.2
Listing 8.4 SpinApp manifest (scaffolded output)
apiVersion: core.spinkube.dev/v1alpha1 kind: SpinApp metadata: name: hello-world-spin spec: image: "ghcr.io/danbugs/serverside-wasm-book-code/hello-world-spin:latest" executor: containerd-shim-spin replicas: 2
The scaffolded SpinApp manifest shows the registry image, Spin executor, and desired replica count that define a deployed application. section 8.2.2
