Deployment

InfraBuffet consists of two kinds of processes sharing one PostgreSQL database:

  • web serves the UI and the API, and schedules jobs;
  • worker picks up jobs from the database and runs Terraform.

Both are the same ibf binary, which you can download from the GitHub releases page.

Load balancer in front of several web processes; web and worker processes connect to PostgreSQL; each worker runs Terraform

Web and worker processes keep no local state, so you can run as many of each as you need. Workers must have the Terraform binary installed; see worker environment for requirements.

Prepare the database

Create a PostgreSQL 17+ database and pass its URL to every process via IBF_DBURL:

export IBF_DBURL='postgres://ibf:<password>@db.example.com:5432/ibf'

Apply migrations and create the first administrator:

./ibf addsuperuser --migrate

This step sets up the database (--migrate flag) and creates a superuser account (you will be prompted with username, email, and password for the user)

Start the processes

Start web servers and workers separately:

./ibf runweb --bind 0.0.0.0:80
./ibf runworker --maxparallel 20

Run them under a process supervisor (systemd, Kubernetes, etc.) that restarts them on failure and collects logs. Jobs are not executed unless at least one worker is running.

For a lab or a single-host setup, ./ibf run starts both in one process.

Load balancer

InfraBuffet speaks plain HTTP. Put your load balancer or reverse proxy in front of the web processes, terminate HTTPS there, and forward all paths, including /api/, to the web servers. Serve the application at the root of its origin.

The session cookie is HTTP-only but has no Secure attribute; set it in your proxy if you need it. If the UI is served from a different origin than the API, configure CORS origins.

Worker environment

Each worker needs:

  • access to PostgreSQL;
  • the Terraform binary. The path to the binary must be identical on all workers;
  • network access to Git repositories, Terraform provider registries, and the APIs of the managed services;
  • writable temporary storage.

Environment variables set on the worker are not passed to Terraform. Provider credentials reach Terraform only through the values of a provider instance, so don’t try to supply variables like AWS_ACCESS_KEY_ID through the worker environment.

Verify

GET /api/health returns {"healthy":true} when a web process is up. It does not check workers or Terraform, so also sign in, run a diff in a test scope, and make sure the job completes.