❗ Attention
- Before bringing up the Vagrantfile VMs, make sure to generate an SSH key for secure connections.
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f ~/.ssh/vagrant-k3s-cluster-sample
-
Start your machines:
vagrant up
💡 Tip
-
To avoid downloading the Vagrant box every time, you can save the desired box (e.g.,
ubuntu/jammy64
) locally by running:vagrant box add ubuntu/jammy64
-
-
List the available boxes:
vagrant box list
-
Stop all running machines:
vagrant halt
-
Destroy your cluster and remove the VMs (including their files):
vagrant destroy
-
Connect to a specific machine (e.g.,
node2
)ssh -i ~/.ssh/vagrant-k3s-cluster-sample [email protected]
-
Navigate to the
ansible
directory, then generate the inventory file using the following command, provideing the node IP addresses:./inventorygen.py 192.168.33.11 192.168.33.12 192.168.33.13
-
The inventory file will be created under the path
inventory
. Modify it as needed to suit your specific configuration.