Files
ovirt-api-simulator/docs/configuration.md
T
inecs cbd0adca91 Initial release of the oVirt/RHV Engine API simulator.
Stateful FastAPI lab with contract packs, Compose/Helm, Docker Hub release
targets, and Pulumi coverage across all Engine series (GET/POST/PUT/DELETE/HEAD).
2026-07-18 04:49:28 +03:00

88 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
**Language / Язык:** [English](configuration.md) | [Русский](ru/configuration.md)
# Configuration
Application settings are loaded from the environment (see `.env.example`).
Docker Compose injects many of these for the `simulator` service.
## Core
| Variable | Default / example | Meaning |
|---|---|---|
| `APP_HOST` | `0.0.0.0` | Bind address |
| `APP_PORT` | `8080` | Internal FastAPI port (not the public Engine port) |
| `DATABASE_URL` | `postgresql://ovirt:ovirt@postgres:5432/ovirt_simulator` | asyncpg DSN |
| `TEST_DATABASE_URL` | same as above | Integration-test DSN |
| `DB_POOL_MIN_SIZE` | `1` | Pool minimum |
| `DB_POOL_MAX_SIZE` | `10` | Pool maximum |
| `LOG_LEVEL` | `INFO` | Logging level |
| `REQUEST_ID_HEADER` | `X-Request-ID` | Request correlation header |
## Engine series and seed
| Variable | Default | Meaning |
|---|---|---|
| `OVIRT_SERIES` | `4.5` | Contract pack at cold start (`3.0``3.6`, `4.3``4.5`, `master`) |
| `SEED_PROFILE` | `minimal` | Used by seed CLI / Helm seed Job (`minimal` / `demo`) |
## Security and tasks
| Variable | Meaning |
|---|---|
| `TICKET_SIGNING_KEY` | Signing material for lab tokens (**change outside toy labs**) |
| `TASK_WORKER_CONCURRENCY` | Leased asyncio workers (132) |
| `TASK_LEASE_SECONDS` | PostgreSQL task lease duration |
| `SIMULATION_TIME_SCALE` | Accelerates simulated job durations |
## Host publish ports
| Variable | Default | Meaning |
|---|---|---|
| `OVIRT_ENGINE_PORT` | `443` | Host → gateway `:443` (Engine HTTPS) |
| `OVIRT_UI_PORT` | `5000` | Host → gateway `:5000` (Web UI) |
See [Ports](ports.md).
## Compose
| File | Role |
|---|---|
| `docker-compose.yml` | Dev stack (build + bind mounts) |
| `docker-compose.release.yml` | Published Hub image |
| `.env` / `.env.example` | Local overrides |
Services:
- **simulator** — FastAPI on internal `8080`
- **api-gateway** — nginx publishing Engine + UI ([ports.md](ports.md))
- **postgres** — `postgres:17.5-bookworm` (host port omitted by default)
- **migrate** — one-shot schema migrations
## Helm
See [Kubernetes / Helm](kubernetes.md) and
[`helm/ovirt-api-simulator/values.yaml`](../helm/ovirt-api-simulator/values.yaml).
| Value | Purpose |
|---|---|
| `image.repository` / `image.tag` | Container image |
| `config.ovirtSeries` | Pack series env `OVIRT_SERIES` |
| `seed.profile` | `minimal` / `demo` |
| `postgresql.enabled` | Bundled DB |
| `databaseUrl` | External DSN when bundled Postgres is off |
| `secrets.ticketSigningKey` | Must be rotated for shared clusters |
| `service.port` | ClusterIP port (default `8080`) |
`gateway.*` / `ingress.*` in `values.yaml` are reserved; the chart currently
exposes FastAPI directly (no Compose-style nginx gateway).
## Contract packs
Location: `contracts/ovirt/<series>/`.
Each series has `api.json`, `manifest.json`, and `deltas.json`. Regenerate:
```bash
make generate-packs
```