lxc / incus-deploy

Deployment playbooks, configurations and scripts for Incus
Apache License 2.0
33 stars 10 forks source link

Incus deployment tools

This is a collection of Ansible playbooks, Terraform configurations and scripts to deploy and operate Incus clusters.

How to get the test setup run:

Install incus and OpenTofu

Install incus stable or LTS on your system from the zabbly/incus release and initialize it on your local machine.

Install OpenTofu.

Install the required ceph packages for ansible on the controller, on Debian that's the ceph-base and ceph-common packages:

apt install --no-install-recommends ceph-base ceph-common

Create the test VMs with OpenTofu

Go to terraform directory:

cd terraform/

Init the terraform project:

tofu init

Create the VMs for testing:

tofu apply

Run the Ansible Playbook

Go to the ansible directory:

cd ../ansible/

Copy the example inventory file:

cp hosts.yaml.example hosts.yaml

Run the Playbooks:

ansible-playbook deploy.yaml

NOTE: When re-deploying the same cluster (e.g. following a terraform destroy), you need to make sure to also clear any local state from the data directory, failure to do so will cause Ceph/OVN to attempt connection to the previously deployed systems which will cause the deployment to get stuck.

Deploying against production systems

Requirements (when using Incus with both Ceph and OVN)

Configuring Ansible

With a deployment against physical servers, Terraform isn't currently used at all. Ansible will be used to deploy Ceph, OVN and Incus on the servers.

You'll need to create a new hosts.yaml which you can base on the example one provided.

You'll then need to do the following changes at minimum:

You'll find more details about the Ansible configuration options in ansible/README.md.