Browse Chapters

Serverless Apps in Kubernetes

Earlier we covered the various serverless solutions in Kubernetes. Here, we talk more specifically about how these applications look when running inside of Kubernetes.

Spin WebAssembly serverless apps can run inside of Kubernetes, and there are several ways to try this out.

Once you have SpinKube installed in any of those environments, you can build and deploy your applications in just four steps:

$ spin new # Create a new app
$ spin build # Compile it to Wasm
$ spin registry push
$ spin kube deploy

Check out a full walkthru of creating and deploying Spin apps to Kubernetes.

This is what the YAML looks like for a simple Spin serverless app:

apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinApp
metadata:
  name: hello-spin
spec:
  image: "ttl.sh/hello-spin:24h"
  replicas: 2

When it is installed, the Spin operator in SpinKube transforms the above into the requisite set of Deployment, Service, Secret and ConfigMap resources necessary. And the Spin shim in Containerd schedules the Wasm binary onto the Spin runtime instead of the container runtime.

Note that while Spin applications are not packaged into Docker containers, almost all of the usual Kubernetes tools work with Spin, including service meshes, volume mounts, telemetry and observability tooling, and autoscalers.

Browse Chapters

Quickstart Your Serveless Apps with Spin

Get Started