Before running the playbook, make sure you have the following requirements installed:
- Ansible: Ansible is an open-source automation tool used for configuration management and application deployment. You can install Ansible by following the instructions in the official Ansible documentation.
- Vagrant: You can download and install Vagrant from the official website. Ensure that Vagrant is properly installed and available in your system's PATH.
- Vagrant Plugin: Install the
vagrant-env
plugin by running the following command:
vagrant plugin install vagrant-env
The vagrant-env
plugin allows Vagrant to load environment variables from a .env
file, which is used to customize the Vagrant configuration.
To quickly get started with the RKE2 cluster setup using Vagrant, follow these steps:
git clone https://github.com/sylvain-pierrot/playbook-rke2-vagrant.git
cd playbook-rke2-vagrant
vagrant up --no-parallel
The --no-parallel
flag ensures that the provisioning is done sequentially instead of in parallel, which can help avoid any potential resource conflicts.
Once the provisioning process is complete, you will have your RKE2 cluster up and running.
The kubeconfig file for the cluster will be created at the root of the project. You can use the following command to interact with the cluster using kubectl:
kubectl --kubeconfig ./kubeconfig [command]
Replace [command] with the desired kubectl command.
To delete the RKE2 cluster, run the following command:
vagrant destroy --force