liveBook · Manning

SpinKube

As explained in Server-Side WebAssembly

The Spin kube plugin is a Spin command-line plugin for deploying Spin applications to Kubernetes, including generating Kubernetes deployment manifests.

SpinKube connects the Spin WebAssembly framework to Kubernetes. Its kube command-line plugin scaffolds Kubernetes resources for Spin applications, while SpinKube’s CRDs and operator let Kubernetes deploy, scale, and manage those workloads with familiar orchestration patterns. section 8.2 section 8.5

A typical SpinKube deployment follows this sequence:

  • Build the Spin application with spin build. section 8.2.2
  • Publish the application as an OCI image to a container registry with spin registry push. section 8.2.2
  • Generate a SpinApp manifest with spin kube scaffold --from, rather than writing the Kubernetes resource by hand. section 8.2.2
  • Apply the generated manifest to the cluster and inspect readiness with kubectl get spinapps. section 8.2.2
  • Test the deployed service through kubectl port-forward and curl. section 8.2.2

Deploying hello-world-spin

A minimal HTTP Spin application can be built, pushed to a registry, and scaffolded into a SpinApp resource. The generated manifest specifies apiVersion core.spinkube.dev/v1alpha1, kind SpinApp, the image, executor containerd-shim-spin, and replicas: 2. Applying it produces two ready replicas; port-forwarding the service and calling localhost:8083/ returns “Hello World from Spin in Kubernetes!”. section 8.2.2

spin plugins update
spin plugins install kube
spin plugins list --installed

The command listing provides the practical installation path for updating Spin plugins, installing kube, and verifying the installed plugin. section 8.2

How Server-Side WebAssembly covers it

How deep it goes
Traces installation, image publication, manifest scaffolding, application, readiness checks, and service testing without detailing operator internals.
Examples
Uses hello-world-spin, a SpinApp manifest, two replicas, kubectl port-forward, and curl verification.
What it assumes
Assumes Spin installation and requires k3d, kubectl, Helm, a Kubernetes cluster, and Rust 1.85.0 or later for the example.
What you can do after
Operate/configure Spin deployments by publishing an image, generating a SpinApp manifest, applying it, and checking the running service.
How it connects
Connects Spin, Kubernetes, custom resource definitions, operators, OCI images, container registries, and Horizontal Pod Autoscaling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.