liveBook · Manning

K3d

As explained in Server-Side WebAssembly

k3d is a lightweight command-line tool for running local Kubernetes clusters in Docker containers.

k3d runs a local Kubernetes cluster in Docker containers. Its fast, lightweight setup makes it a practical development and testing environment before deploying Spin-based WebAssembly workloads to Kubernetes. section 8.2

For a SpinKube environment, create a cluster with a k3d image containing the containerd-shim-spin runtime. The setup exposes the cluster load balancer’s port 80 on local port 8081 and adds two agent nodes for scheduled workloads. section 8.2.1

Create a local Wasm cluster

Run the cluster-create command, then prepare Kubernetes with cert-manager, a Spin RuntimeClass, SpinKube CRDs, and the Spin operator. The custom image enables Kubernetes to launch Spin-based Wasm workloads. section 8.2.1

k3d cluster create wasm-cluster --image ghcr.io/spinframework/containerd-
➥shim-spin/k3d:v0.19.0 --port "8081:80@loadbalancer" --agents 2

Creates the wasm-cluster with the Spin-enabled k3d image, local load-balancer port mapping, and two agent nodes. section 8.2.1

How Server-Side WebAssembly covers it

How deep it goes
Explains cluster creation and its Spin runtime, port, and agent-node configuration without detailing k3d internals.
Examples
Demonstrates creating wasm-cluster with a Spin-enabled image, port 8081 mapping, and two agent nodes.
What it assumes
Assumes Spin, kubectl, and Helm are installed while introducing local cluster creation from zero.
What you can do after
Operate/configure a local two-agent Kubernetes cluster ready for Spin-based Wasm workloads.
How it connects
Connects Kubernetes clusters with SpinKube, Docker, kubectl, Helm, RuntimeClass, cert-manager, and containerd-shim-spin.

Also explained in

Compare how 3 books explain k3d →

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.