Skip to content

Deploy a HA k3s Cluster

You can use this script to provision a k3s cluster on your computer (tested on a Mac) using k3sup, multipass.

Kudos go to Tom Watt and his article Creating a k3s cluster with k3sup and multipass.

Usage

Print help message:

./install-k3s-with-multipass.sh -h

Example: Install 3 node cluster wiht 3 CP nodes

./install-k3s-with-multipass.sh \
  --control-plane-nodes 3 \
  --worker-nodes 3 \
  --name k3s \
  --worker-cpus 2 \
  --worker-memory 8G

Delete everything

Simply delete all VMs managed by multipass:

multipass delete --all && multipass purge

CAUTION: this will delete ALL VMs, if you have more VMs managed with multipass, use this command instead:

multipass delete --purge <VM name1>
multipass delete --purge <VM name2>

Known Issues

When you use iTerm2 and see the following issue with multipass shell <node>

ssh: connect to host 192.168.252.248 port 22: No route to host

then you might need to allow local network connections for iTerm2, see this stackexchange.