Back to Blog Posts

Introducing k3m: Simple Kubernetes Clusters with Multipass VMs

15 Apr 2025

By Bruno Bernard

Open source enthusiast from Mauritius Island.

Like many in the Kubernetes ecosystem, I’ve spent my fair share of time exploring different tools to stand up local clusters. Whether it’s for testing out new workloads, experimenting with persistent storage solutions, or just learning more about Kubernetes internals, having a local cluster that's easy to spin up and tear down is invaluable.

This need is what led to the creation of k3m — a small but handy CLI that leverages Canonical’s Multipass to launch lightweight k3s clusters in virtual machines, with minimal fuss.

Let me tell you a bit about how this project came to be, and why I chose this approach over more common tools like kind and k3d.


The Problem with Containers-for-Clusters

Tools like kind and k3d are incredible — fast, container-based, and very well-suited for many use cases. I’ve used both, and I still recommend them when they fit the job. But when it came to one specific challenge, they didn’t quite cut it.

I was working with Longhorn, a cloud-native distributed block storage system, and trying to test it out on a local k3s cluster. The catch? Longhorn depends on certain low-level features (like raw block devices and full disk access) that aren’t always possible or reliable in container-based environments. After hitting some roadblocks with Longhorn inside kind and k3d, I realized: I needed virtual machines — not containers.


Why Canonical Multipass?

Once I started looking into VM-based solutions, I wanted something fast, lightweight, and scriptable. That’s when I stumbled upon Multipass by Canonical — and it clicked immediately. It was exactly what I needed. All that was missing was a tool to manage k3s clusters on top of Canonical's Multipass.


Enter k3m

That’s where k3m comes in — k3s + Multipass = k3m.

It’s a small Python-based CLI that makes it easy to create, list, scale, start, stop, and delete k3s clusters using Multipass VMs as the underlying infrastructure. Whether you want a single-node setup or a cluster with multiple agents and servers, k3m helps you spin it up quickly — and cleanly.

A few things k3m takes care of for you:

  • Spinning up VMs for each server/agent node

  • Installing k3s using the official install script

  • Configuring the cluster with optional load balancers

  • Managing kubeconfig so you can kubectl right away


Why Use k3m?

If you're building something that needs a real Linux environment, or testing tools that interact with storage, the filesystem, or networking at a low level, running Kubernetes in a VM-based environment is a smart choice.

Here’s when you might prefer k3m + Multipass over kind or k3d:

  • You need to test persistent storage solutions like Longhorn

  • You want a more “real” Linux environment to simulate production

  • You need to test in isolated, VM-level sandboxes

  • You want to avoid Docker entirely (yes, that’s possible too)


Getting Started

You can install k3m via pipx:

pipx install k3m

Or check out the repo on GitHub: github.com/eznix86/k3m

Once installed, spinning up a cluster is as easy as:

k3m cluster create dev-cluster --servers 1 --agents 2

And then:

kubectl get nodes

Boom — your cluster is live in Multipass VMs.


A Tool for Builders

At the end of the day, k3m is just a tool I built to scratch my own itch. But if you’ve ever struggled to get something running in a container-based local cluster, or if you just want the peace of mind that comes from running inside actual virtual machines, I hope k3m helps you too.

Give it a try, open an issue, or send a PR — I’d love to hear what you think.

Happy clustering!