Shikari: A Multi-VM launcher using Lima #2709
Ranjandas
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Nice!
I'd rather suggest |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been working on a small tool written in Golang that helps create multi-vm clusters using Lima. It is heavily opinionated and primarily geared towards launching clusters for HashiCorp tools (like Nomad, Consul, etc.) but is general-purpose enough to build anything based on Lima templates.
Ref: https://github.com/Ranjandas/shikari
The UX of the tool is simple in that it only requires you to pass the following:
--name/-n
)--server/-s
) and Server (--client/-c
) VMs--template/-t
--image/-i
(optional if already included in the template)In addition, it lets you inject environment variables into the VMs using the
--env/-e
option.The VMS are launched with predictable names in the form of
<cluster-name>-srv-xx
for servers and<cluster-name>-cli-xx
for the clients, respectively. These names help the VMs to be addressed easily when using DNS.Here is an example of how a multi-node K3S cluster is launched using Shikari.
To access the K3S cluster, the
env
helper command populates theKUBECONFIG
environment variable.Shikari also has a
scale
option, which lets you add or remove VMs from either the client or server pool.Internals
Networking
All scenarios are expected to use
socket_vmnet
networking mode. I found this to be the best option when running multi-node, where the nodes can talk to each other and the services can also be accessed from the host.DNS
The images used are pre-configured to use systemd-resolved with mDNS support. For scenarios using upstream images, the lima template provisioners make these necessary configurations. This allows every node to talk to the others using DNS names. Eg: lima-k3s-srv-01.local, lima-k3s-cli-01.local etc.
Scenarios
Ref: https://github.com/Ranjandas/shikari-scenarios
The tool is accompanied by a scenarios repository (shikari-scenarios) that contains the templates for creating clusters. This repository also includes a packer file that bakes an image that contains all the software required to launch the clusters. This choice was made so that the internet speed does not slow down the launch of multiple VMs while packages are installed on startup.
Demo
Here is an asciicast of launching a Kubernetes cluster based on the k3s-multinode scenario.
Beta Was this translation helpful? Give feedback.
All reactions