Skip to content

k8sautom8/macOsMultipassK8S

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

README.md


🚀 macOS Multipass Kubernetes Setup

An Ansible playbook to set up a Kubernetes cluster on macOS using Multipass for VM management. Ideal for Mac Mini M4 or any macOS system!
Playbook is Idempotent means you can run as many times as you can withou affecting the setup

📌 Prerequisites

1️⃣ Install Multipass

Multipass allows you to create and manage lightweight Ubuntu VMs on macOS.

🔗 Download: Multipass for macOS
📖 Setup Guide: Multipass Docs

2️⃣ Install Homebrew

Homebrew is the missing package manager for macOS.

📖 Install it using:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

🔗 Homebrew Website

3️⃣ Install Ansible

🔹 Once Homebrew is installed, install Ansible with:

brew update  
brew install ansible  

🚀 How to Run the Playbook

🔹 Once all prerequisites are installed, clone this repository and run the playbook:

git clone https://github.com/k8sautom8/macOsMultipassK8S.git
cd macOsMultipassK8S

🔹 Please edit playbook vars section -> network: en1 and replace with you own interface name, en1=wifi in my case see below,

% multipass networks
Name   Type       Description
en0    ethernet   Ethernet
en1    wifi       Wi-Fi
en5    ethernet   Ethernet Adapter (en5)
en6    ethernet   Ethernet Adapter (en6)
en7    ethernet   Ethernet Adapter (en7)

🔹 Execute the Playbook

/opt/homebrew/bin/ansible-playbook multipass-standup.yaml

This will automatically:
✅ Create and configure Multipass VMs (1 Master/Control Plane VM and 3 Worker Node VMs)
✅ Install Kubernetes (Kubeadm, Kubelet, Kubectl)
✅ Configure networking and Calico CNI
✅ Set up kubectl access on the master node


🛠️ Manually Managing Multipass VMs

🔹 List all VMs:

multipass list

🔹 Stop a VM:

multipass stop <vm-name>

🔹 Start a VM:

multipass start <vm-name>

🔹 Delete a VM:

multipass delete <vm-name> && multipass purge

❓ Troubleshooting

🔹 If Multipass VMs are not starting, restart the Multipass service:

multipass stop --all && multipass start --all

🔹 If Ansible fails due to missing dependencies, rerun:

brew update && brew reinstall ansible

🔹 If Kubernetes pods are not coming up, check logs:

kubectl get pods -A

🔹 Clean-Up:

multipass delete -all  # This will delete all VMs
multipass purge # This will purge all deleted VMs, if you do not purge the VMs can be recovered using 'recover' command

📌 Contributing

Feel free to open issues, submit pull requests, or suggest improvements! 🚀

📄 License

This project is licensed under the MIT License.


💡 Enjoy your Kubernetes cluster on macOS! 🚀🎉

About

Standup Kubernetes environment on Mac M4 using Multipass

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors