Declarative Incus configuration management with incus-apply

I am happy to introduce incus-apply, a tool for declarative incus configuration management.

I have been mulling over the idea for a while. I was able to finally put something together and for the past few days adopted it for all my incus related setups.

Why?

The incus cli is very easy and simple to use, coupled with the webui. However, it is lacking an easy (and reproducible) way to define resources.

There are existing options like the terraform provider and incus-compose.

Terraform is more suited to complex infrastructure setups, and it can be an overkill when you simply want to define few instances. Incus-compose on the other hand does not fully align with incus as it provides a docker focused perspective.

incus-apply is exactly incus with no learning curve and no translation layer. If you can use the Incus cli, you can use incus-apply.

Configuration

Example config for a debian container.

# Basic Debian container
kind: instance
name: debian
image: images:debian/13
config:
  limits.cpu: "2"
  limits.memory: 2GiB
description: Debian container

A simple incus-apply debian.yaml afterwards would have the instance up and running. And a subsequent incus-apply -d debian.yaml would tear down the instance.

Demo

Feedbacks pls

The project is available at https://github.com/abiosoft/incus-apply. Kindly give it a try and share your experiences :slight_smile:

14 Likes

Just a suggestion but if you enable the GitHub repo “wiki” it might be a good place for users to provide or get info such as Q&A, Tips, Examples w/out resorting to opening “issues”.

1 Like

Enabled :white_check_mark:

This looks really useful, thank you for building it! Right now I have some things scripted with incus commands, and I like the idea of replacing those with declarative configuration.

1 Like

Thank you, interesting idea — I liked it a lot.

1 Like