This repository contains a CLI that automates the deployment of a Kubernetes cluster on Multipass, a lightweight VM manager for Linux, macOS, and Windows.
Before using this tool, you will need to have the following installed on your machine:
- Multipass
go install github.com/ryota-sakamoto/kubernetes-on-multipass/cmd/kom@latestTo create a Kubernetes cluster on Multipass and install CNI with Helm, simply run the following command:
kom create clusterThis will launch two Multipass instances, a master and a worker, and generate a Kubernetes configuration file. It will then join the worker to the cluster and install the Cilium CNI using Helm.
$ kubectl get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
kubernetes-master Ready control-plane 2m49s v1.34.0 192.168.205.73 <none> Ubuntu 24.04.3 LTS 6.8.0-71-generic containerd://1.7.0
kubernetes-worker Ready <none> 72s v1.34.0 192.168.205.74 <none> Ubuntu 24.04.3 LTS 6.8.0-71-generic containerd://1.7.0You can also run each command separately:
# Launch the worker instances
kom create worker
# Generate a Kubernetes configuration file
kom generate kubeconfig
# Install CNI with Helm
kom install cniTo run a command on the instance, run:
kom exec master -- bashTo clean up the resources, run:
kom cleankom supports generating shell completion scripts for various shells via cobra.
To load completions for the current session:
source <(kom completion bash)To make completions available for all sessions, you can add the completion script to your system's bash completion directory:
kom completion bash > /etc/bash_completion.d/kom # Linux
kom completion bash > /usr/local/etc/bash_completion.d/kom # macOSTo load completions for the current session:
kom completion fish | sourceTo make completions available for all sessions, save the completion script to your fish completions directory:
kom completion fish > ~/.config/fish/completions/kom.fish