March 13, 2024

Introducing SpinKube and Fermyon Platform for Kubernetes

Radu Matei & Mikkel Mørk Hegnhøj Radu Matei & Mikkel Mørk Hegnhøj

spin wasm kubernetes webassembly

Introducing SpinKube and Fermyon Platform for Kubernetes

Today, we are proud to introduce SpinKube and the Fermyon Platform for Kubernetes. Both projects enable Kubernetes to get first-class support for running Spin WebAssembly (Wasm) applications. SpinKube allows you to run your applications far more efficiently and with higher density across any processing architecture in your Kubernetes cluster.

SpinKube is an open source project that streamlines the experience of developing, deploying, and operating Wasm workloads on Kubernetes. SpinKube combines the Spin Operator, containerd Spin shim, and the runtime class manager (formerly KWasm) open source projects with contributions from Microsoft, SUSE, Liquid Reply, and Fermyon. It’s available today and free to use.

Fermyon Platform for Kubernetes delivers unprecedented application density and operational efficiency on Kubernetes clusters in a robust, easy-to-use serverless platform that lets developers quickly deploy Wasm applications to Kubernetes. As well as letting you run more workloads on your cluster, it scales up and down based on usage: up to thousands of applications per node in less than a second, and down to zero when things are quiet. This rapid scaling translates to optimal resource usage, which translates to savings! And you can run container-based workloads on the same nodes as Wasm workloads - no need for separate node pools. Fermyon Platform for Kubernetes runs on self-hosted infrastructure, whether cloud-hosted or on-premise, alleviating vendor lock-in, and is available today - reach out for more information!

A Look Back at Where We Are With Spin and Wasm

Since the initial release of Spin, our mission has been to enable Wasm as a core technology in the next wave of cloud computing. With the release of Spin 2.2, we have implemented support for WASI 0.2, and today Spin gives you the best developer experience for producing wasi-http compatible Wasm components.

WASI-http components have up until now had many compatible hosts: Spin as a CLI, Fermyon Cloud, Wasmtime, and NGINX Unit (to mention some). Today’s releases add SpinKube and Fermyon Platform for Kubernetes to that list, enabling these portable workloads to run in Kubernetes.

SpinKube - In a Bit More Detail

The SpinKube project is a collection of existing and new open source technologies. The project’s goal has been to gather and align the bits and pieces needed to make it really easy to run Spin Wasm applications on Kubernetes. Let’s see how easy it is:

Five shell commands to deploy a spin application

The Containerd Shim for Spin

At the core of the project is the Containerd Shim for Spin. This shim implementation, uses runwasi, to enable containerd to run Spin Wasm applications in a Kubernetes cluster. The shim provides all the capabilities needed in a Kubernetes cluster, such as pulling application images from registries, starting the applications and injecting configuration. This project has been contributed by the Microsoft Deislabs team to the SpinKube project.

The Runtime Class Manager

The Runtime Class Manager is the successor to Kwasm, and is a contribution by Liquid Reply and SUSE to SpinKube. The Runtime Class Manager enables you to easily annotate your nodes, install and configure containerd with the Spin shim, and thus enable them to run Spin Wasm applications.

The Spin Operator

Now this wouldn’t be a true Kubernetes project without an Operator :-) The Spin Operator enables you to define Spin Wasm applications as native Kubernetes resources, and to orchestrate the creation of deployments, pods, and services. This facilitates their integration with containers, ensuring Spin Wasm applications behave just like you’d expect from any workload deployed on Kubernetes. Developed and contributed by Fermyon to the SpinKube project, the Spin Operator enriches Kubernetes’ ecosystem with advanced Wasm capabilities.

The spin kube Plugin

To make sure you get the best experience as a developer and operator, we’ve also enabled easy integration with the Spin CLI by including the Kubernetes plugin for Spin. This enables the easy steps of spin new —> spin build —> spin registry push —>spin kube scaffold —>kubectl -f apply. Fermyon also contributed to the Kubernetes plugin for Spin.

Bringing all these projects together under a non-restrictive open source license enables everyone to start enjoying Spin Wasm workloads in Kubernetes.

Fermyon Platform for Kubernetes

The Fermyon Platform for Kubernetes brings our technology behind Fermyon Cloud to your Kubernetes clusters. Fermyon Cloud is a highly scalable, multi-tenant Wasm platform that has proven to achieve extreme density of applications by hosting more than 5,000 applications on a single node. 20 times the current pod limit in Kubernetes and often 50-100 times the number of pods running on a Kubernetes node. Starting today, we can show you how to host 5,000 applications on a single Kubernetes node using the Fermyon Platform for Kubernetes.

The Fermyon Platform for Kubernetes delivers extremely high application density within Kubernetes environments through a specialized runtime. This specialized runtime is especially great for scenarios featuring a large number of applications with fluctuating utilization over time. It ensures applications are instantly available (always scaled up without consuming resources), eliminating the need for complex scaling rules. Finally, all of this translates into immediate cost savings — 60% in the case of ZEISS Group.

This platform is seamlessly integrated with the Spin Operator, allowing you to choose between two runtime environments for your applications: the containerd-shim-spin or the Fermyon Platform’s native runtime. This flexibility offers the best of both worlds.

For more information about The Fermyon Platform for Kubernetes and to request a demonstration, please reach out here.

Why Do We Need Spin Wasm Applications in Kubernetes?

Wasm brings us a lot of great benefits when developing services. The binary output is really small; it starts instantaneously, is sandboxed, and is portable across processing architectures and operating systems. All of these benefits from Wasm can be directly mapped to improvements in how we can run workloads in Kubernetes and help solve some of today’s challenges when using containers:

  • The binary output is really small.

    • A key piece of any orchestration engine is efficiently placing a workload on a given node to run it. Smaller binaries make downloading, extracting, and eventually running a workload quick. A hello-world Spin Wasm application written in Rust is a 284KiB OCI image.

    OCI Manifest of a WebAssembly image

  • They start up almost immediately.

    • Once scheduled, a Spin Wasm component will start in less than a millisecond. This is particularly beneficial for Spin applications consisting of multiple components, and for any application scheduled with the Fermyon Platform for Kubernetes, as they are only loaded and run when needed.

    SpinExecutor performance graph

  • They are sandboxed.

    • Wasm components are sandboxed and are, by default, denied access to resources on the system - e.g., the filesystem or networking - through its capability-based security design. This makes the workloads safe for hosting untrusted code and enables you to efficiently host multiple apps in a single runtime instance, which is part of the efficiency the Fermyon Platform for Kubernetes runtime brings.

    Illustration of sandboxed WebAssembly modules

  • They are portable across processing architectures and operating systems.

    • You can swap out the underlying node’s processing architecture without producing separate pipelines and deploying artifacts. In many cases, switching to an ARM64-based server gives you an immediate cost saving.

      Illustration of one WebAssembly module running on multiple CPU arhictectures

Early Adopters and Collaborators

ZEISS, Microsoft and Fermyon have been working on testing SpinKube with Azure Kubernetes Service and existing workloads which ZEISS is running today. The setup includes the use of Azure Service Bus, Dapr, KEDA, Azure Kubernetes Service, Spin, and SpinKube to validate how well Spin Wasm applications perform in this environment, compared to the existing implementation using containers.

“Utilizing Spin WebAssembly with SpinKube on Microsoft’s Azure Kubernetes Service helps us to achieve faster scalability, and reach higher density without the need to dramatically change our operational posture. With that we’ve been able to take a Kubernetes batch process of tens of thousands of orders and cut the compute cost by 60% without trading off performance,” said Kai Walter, Distinguished Architect, ZEISS Group. “We are excited to see WebAssembly become a first-class workload in Kubernetes. SpinKube and Fermyon Platform for Kubernetes will reshape how we all do high-performance computing in Kubernetes.”

Some members of the cloud-native community have also had a chance to try out SpinKube before the launch, providing the following feedback on the experience:

“The SpinKube project uses all the conventional Kubernetes tools to easily get it installed and set up. It took me 5 minutes before I could start deploying Spin WebAssembly applications to my cluster,” said Kasper Juul Hermansen, Platform/Data Engineer, Lunar.

Want to learn more? Check out these resources:

🔥 Recommended Posts

Quickstart Your Serveless Apps with Spin

Get Started