> ## Documentation Index
> Fetch the complete documentation index at: https://inframan.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# inframan.yaml reference

> Every field of inframan.yaml: services, builds, routing, scaling, resources, health checks, environment, connections and per-environment overrides.

`inframan.yaml` sits at the root of your repository and describes your application: its services, how each one is built, how it scales, what it's connected to, and how any of that differs between environments. It's the source of truth. Inframan reads it on every release, and settings you change in the console are written back to it through a pull request.

## A minimal file

```yaml inframan.yaml theme={null}
version: v1
application: my-app
services:
  web:
    port: 8080
```

This declares one web service, built from `./Dockerfile` and listening on port 8080.

## A complete example

```yaml inframan.yaml theme={null}
version: v1
application: shop
namespace: shop

pipeline_variables:
  MIGRATE_CMD: "npm run migrate"

services:
  api:
    type: web
    port: 8080
    node_pool: app-pool
    domain: api.example.com
    path_prefix: /
    scaling:
      type: hpa
      min_replicas: 2
      max_replicas: 6
      cpu: 70
    resources:
      cpu_request: 250m
      memory_request: 256Mi
      cpu_limit: "1"
      memory_limit: 512Mi
    network:
      readiness_probe:
        path: /healthz
        timeout_seconds: 3
        period_seconds: 10
        initial_delay_seconds: 0
        failure_threshold: 3
    build:
      dockerfile: services/api/Dockerfile
      watch_paths: [services/api, packages/shared]
    env:
      LOG_LEVEL: info
    envGroups: [shared-config]
    secrets:
      STRIPE_KEY: stripe-key
    connections:
      DATABASE_URL: postgres/main
      CACHE_URL: redis/cache
    environments:
      nonprod:
        service:
          scaling:
            min_replicas: 1
            max_replicas: 2
        env:
          LOG_LEVEL: debug

  worker:
    type: worker
    node_pool: app-pool
    start_command: node dist/worker.js
    termination_grace_seconds: 120
    scaling:
      type: "off"
      min_replicas: 2
    build:
      dockerfile: services/api/Dockerfile
    connections:
      API_URL: service/shop/api
      DATABASE_URL: postgres/main
```

This example assumes the infrastructure has a node pool named `app-pool`, an active domain `api.example.com`, PostgreSQL and Redis add-ons named `main` and `cache`, an infrastructure secret `stripe-key` and an env group `shared-config`.

## Top-level fields

**version** `string` *required*

Always `v1`.

**application** `string` *required*

The application's name. It must match the name the application was created with, and it can't change afterwards.

**namespace** `string` (default: application)

The Kubernetes namespace the application's services run in. Defaults to the application name. It can't change afterwards.

**services** `map` *required*

The application's services, keyed by service name. At least one is required. See [Service fields](#service-fields).

**pipeline\_variables** `map of strings`

Values substituted for `{{NAME}}` in your pipelines' pre-deploy and post-deploy commands. Top level only: they can't be set per environment. See [Pipelines](https://inframan.mintlify.site/deploy/pipelines.md).

**rollout** `object`

The default rollout for every service. See `rollout` under [Release](#release).

> [!WARNING]
>
> `application` and `namespace` are permanent. If a push changes either one, that release fails and Inframan opens a pull request titled **auto-fix: immutable inframan.yaml fields drifted** that puts them back.

## Service fields

### Basics

**type** `string` (default: web)

* `web`: an HTTP service that receives traffic on `port`.
* `worker`: a long-running process with no inbound traffic, such as a queue consumer.
* `job`: runs to completion once per release.

See [Services and runtimes](https://inframan.mintlify.site/deploy/services.md).

**port** `integer`

The port a web service listens on. Required for `web`. Inframan sets the `PORT` environment variable to it, so don't set `PORT` yourself. These ports are reserved by the platform: 8012, 8022, 8112, 9090, 9091, 15020, 15021 and 15090.

**node\_pool** `string`

The application node pool the service runs on. Required when the infrastructure has more than one application pool, and filled in for you when it has exactly one. See [Node pools](https://inframan.mintlify.site/provision/node-pools.md).

**start\_command** `string`

Overrides the image's command. It runs as `/bin/sh -c "<start_command>"`, so the image needs `/bin/sh`. Don't use double quotes inside it.

### Build

**path** `string` (default: "")

The build context, relative to the repository root. Empty means the repository root. In a monorepo, set it to the service's directory, or leave it empty if the `Dockerfile` needs files from sibling directories.

**build** `object`

**properties**

**method** `string` (default: docker)

How the image is built. Use `docker`.

**dockerfile** `string` (default: ./Dockerfile)

The Dockerfile, relative to `path`.

**watch\_paths** `list of strings`

Directories whose changes should rebuild this service. When none of them changed, the release reuses the service's last image. Paths are relative to the repository root, can't use globs, and must stay inside the repository. See [Builds](https://inframan.mintlify.site/deploy/builds.md).

### Routing

**domain** `string`

The public hostname for a web service, such as `api.example.com`. The domain must already be active on the same infrastructure. Without a domain, a service is only reachable from inside the cluster. See [Custom domains](https://inframan.mintlify.site/deploy/domains.md).

**path\_prefix** `string`

The path under `domain` that routes to this service, such as `/api`. Several services can share one domain on different prefixes.

**path\_rewrite** `string`

What `path_prefix` is rewritten to before the request reaches the service, such as `/`.

### Scaling

**scaling** `object`

**properties**

**type** `string`

* `concurrency`: scale on requests in flight, down to zero. Needs [Knative](https://inframan.mintlify.site/provision/add-ons/knative.md).
* `hpa`: scale on CPU, and optionally memory, utilization.
* `"off"`: a fixed number of replicas. Quote it, because a bare `off` is a boolean in YAML.

When it isn't set, a web service uses `concurrency` if Knative is installed and `hpa` if not. Each type accepts only its own fields.

**min\_replicas** `integer` (default: 1)

The fewest replicas. `0` lets a `concurrency` service scale to zero. Under `hpa`, `0` runs as one replica.

**max\_replicas** `integer` (default: 5)

The most replicas. At least 1, and no lower than `min_replicas`.

**target** `integer` (default: 100)

`concurrency` only. Concurrent requests per replica before Knative adds another.

**cpu** `integer` (default: 70)

`hpa` only. Target CPU utilization, in percent of the request, from 1 to 100.

**memory** `integer`

`hpa` only. Target memory utilization, in percent, from 1 to 100.

### Resources

**resources** `object`

Kubernetes quantities such as `250m` or `512Mi`.

**properties**

**cpu\_request** `string` (default: 100m)

CPU reserved for each replica.

**memory\_request** `string` (default: 128Mi)

Memory reserved for each replica.

**cpu\_limit** `string` (default: 500m)

The most CPU a replica may use. The default is for non-production infrastructures.

**memory\_limit** `string` (default: 256Mi)

The most memory a replica may use before it's restarted. The default is for non-production infrastructures.

### Network and health checks

**network** `object`

**properties**

**timeout\_seconds** `integer` (default: 300)

Request timeout, from 1 to 600 seconds. Applies to `concurrency` services.

**readiness\_probe** `object`

An HTTP GET on the service's port. Traffic only reaches a replica once it passes. Fields: `path`, `timeout_seconds`, `period_seconds`, `initial_delay_seconds`, `failure_threshold`.

**liveness\_probe** `object`

An HTTP GET that restarts the replica when it keeps failing. Same fields.

**startup\_probe** `object`

An HTTP GET that holds off the other probes until the service has started. Same fields.

**vs\_annotations** `map of strings`

Annotations added to the service's Istio VirtualService.

Probes apply to web services only.

### Environment

**env** `map of strings`

Plain environment variables. They're also passed to the build as build arguments.

**envGroups** `list of strings`

[Env groups](https://inframan.mintlify.site/deploy/environment-variables.md#env-groups) to attach, by name. A group listed later wins over one listed earlier.

**secrets** `map of strings`

Environment variable name to infrastructure secret name, for example `STRIPE_KEY: stripe-key`. The value is read from your cloud's secret manager at deploy time.

**connections** `map of strings`

Environment variable name to the thing it connects to. Inframan fills in the value:

* `postgres/<instance>`, `redis/<instance>`: the add-on's connection URL.
* `storage/<instance>`: the bucket's name.
* `service/<application>/<service>`: the internal URL of another web service.

See [Connections](https://inframan.mintlify.site/deploy/connections.md).

How these combine, and which wins when two set the same name, is covered in [Environment variables and secrets](https://inframan.mintlify.site/deploy/environment-variables.md#precedence).

### Release

**rollout** `object`

**properties**

**strategy** `string` (default: blue-green)

* `blue-green`: the new version starts next to the old one, and the old one stops once traffic has moved.
* `recreate`: the old version stops before the new one starts, at the cost of a short gap. Use it for a worker that must never run twice at once, or when the node pool has no room for a second copy.

A service's `rollout` overrides the application's. For a gradual move of traffic, split it between revisions instead. See [Revisions and traffic](https://inframan.mintlify.site/deploy/revisions.md).

**termination\_grace\_seconds** `integer` (default: 30)

How long a replica gets to finish its work after it's asked to stop, from 1 to 3600 seconds.

## Environment overrides

A service can change its settings per environment under `environments.prod` or `environments.nonprod`. The infrastructure's tag decides which one applies.

```yaml inframan.yaml theme={null}
services:
  api:
    port: 8080
    scaling:
      type: hpa
      min_replicas: 3
    environments:
      nonprod:
        service:
          domain: api.staging.example.com
          scaling:
            min_replicas: 1
        env:
          LOG_LEVEL: debug
```

| Field | How the override combines |
| - | - |
| `service` | Merged field by field. Runtime settings such as `scaling`, `resources`, `domain` and `network` must be inside `service:`. |
| `env` | Merged. The override wins for keys in both. |
| `envGroups` | Replaces the list. An empty list, `[]`, removes every group. |
| `connections` | Replaces the map. |
| `secrets` | Replaces the map. |

> [!WARNING]
>
> A runtime setting placed directly under the environment, such as `environments.nonprod.scaling`, is silently ignored. Put it under `environments.nonprod.service`. An override that sets `cpu` or `memory` must also repeat `type: hpa`.

## Several applications in one file

A repository can hold more than one application. Instead of `application:` and `services:`, list each one under `applications:`, keyed by application name:

```yaml inframan.yaml theme={null}
version: v1
applications:
  storefront:
    services:
      web:
        port: 3000
  admin:
    namespace: admin
    services:
      web:
        port: 3000
        path: admin
```

Each section is created as its own application, under its own name. A file can't use both forms, and two sections can't share a namespace.

## Validation

* When you create an application, an invalid file is refused, with the reason.
* When you push, an invalid file fails the release before anything is built, and the error is on the release's page.
* If a branch you push has no `inframan.yaml`, the release fails and Inframan opens a pull request that adds one.

> [!NOTE]
>
> Unknown keys are ignored rather than rejected, so a misspelt field has no effect. If a setting doesn't seem to apply, check its spelling against this page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.