Skip to main content
🎤 Speaking at KubeCon EU 2026 Lessons Learned Orchestrating Multi-Tenant GPUs on OpenShift AI View Session
🎤 Speaking at Red Hat Summit 2026 GPUs take flight: Safety-first multi-tenant Platform Engineering with NVIDIA and OpenShift AI Learn More
Platform Engineering

WebAssembly on Kubernetes: Running Wasm Workloads with SpinKube

Luca Berton 1 min read
#kubernetes#webassembly#wasm#spinkube#cloud-native

🧩 WebAssembly Meets Kubernetes

WebAssembly (Wasm) is no longer just a browser technology. In 2026, SpinKube brings Wasm workloads to Kubernetes as first-class citizens — with cold start times under 1ms, memory footprints 10x smaller than containers, and polyglot runtime support.

Why Wasm on Kubernetes?

MetricContainerWasm
Cold start1-30 seconds< 1 ms
Image size100MB-1GB1-10MB
Memory overhead50-200MB5-20MB
IsolationProcess/namespaceSandboxed VM
LanguagesAny (Dockerfile)Rust, Go, Python, JS, C++

SpinKube: The Stack

SpinKube combines three components:

  1. Spin Operator: Kubernetes operator for Wasm workloads
  2. Runtime Class Manager: Manages containerd shims for Wasm runtimes
  3. Spin Plugin for Kubernetes: CLI tools for development

Installation

# Install cert-manager (prerequisite)
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.0/cert-manager.yaml

# Install SpinKube
kubectl apply -f https://github.com/spinkube/spin-operator/releases/download/v0.4.0/spin-operator.crds.yaml
kubectl apply -f https://github.com/spinkube/spin-operator/releases/download/v0.4.0/spin-operator.runtime-class.yaml
kubectl apply -f https://github.com/spinkube/spin-operator/releases/download/v0.4.0/spin-operator.shim-executor.yaml
helm install spin-operator oci://ghcr.io/spinkube/charts/spin-operator

Deploy a Wasm App

apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinApp
metadata:
  name: api-gateway
spec:
  image: "ghcr.io/my-org/api-gateway:v1.0"
  executor: containerd-shim-spin
  replicas: 3
  resources:
    limits:
      memory: "32Mi"
      cpu: "100m"

Build a Spin Application

use spin_sdk::http::{IntoResponse, Request, Response};
use spin_sdk::http_component;

#[http_component]
fn handle_request(req: Request) -> anyhow::Result<impl IntoResponse> {
    let uri = req.uri();
    let body = format!("Hello from Wasm! Path: {}", uri);
    
    Ok(Response::builder()
        .status(200)
        .header("content-type", "text/plain")
        .body(body)
        .build())
}

Use Cases

1. API Gateways and Edge Functions

Sub-millisecond cold starts make Wasm ideal for serverless-style API handlers. No more paying for idle containers.

2. Plugin Systems

Let users deploy custom logic as Wasm modules — sandboxed, resource-limited, and language-agnostic.

3. Event Processors

Process Kafka/NATS events with minimal resource overhead. Run thousands of Wasm instances on a single node.

4. AI Inference Pre/Post-Processing

Use Wasm for lightweight data transformation before and after model inference. Keep GPU pods for the heavy lifting.

Wasm + Containers: Better Together

You don’t have to choose. Run Wasm and containers side by side:

apiVersion: v1
kind: Pod
spec:
  containers:
  - name: main-app
    image: myapp:latest  # Traditional container
  - name: sidecar-processor
    image: ghcr.io/my-org/processor:v1.0
    runtimeClassName: wasmtime-spin  # Wasm sidecar

Current Limitations

  • Networking: Limited socket support (improving rapidly)
  • Filesystem: Read-only by default, limited write support
  • GPU access: Not yet supported (containers still needed for AI inference)
  • Debugging: Tooling is immature compared to containers
  • Ecosystem: Fewer pre-built components than container ecosystem

Getting Started

  1. Start with a stateless HTTP service — the sweet spot for Wasm today
  2. Use Rust or Go — best Wasm compilation support
  3. Deploy alongside containers — Wasm complements, doesn’t replace
  4. Monitor cold starts and memory — validate the performance claims in your environment

Wasm on Kubernetes is production-ready for the right workloads. Start experimenting now.


Exploring WebAssembly for your platform? I help teams evaluate and adopt emerging cloud-native technologies. Get in touch.

Share:

Luca Berton

AI & Cloud Advisor with 18+ years experience. Author of 8 technical books, creator of Ansible Pilot, and instructor at CopyPasteLearn Academy. Speaker at KubeCon EU & Red Hat Summit 2026.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens TechMeOut