Services in the file
The fields of a service in clusterz.yaml, and the rules each one is held to.
Each entry of services is one service of the app. Only name is required.
| Field | What it does |
|---|---|
services[].name | The service's name: lowercase letters, digits and hyphens, up to 30 characters, starting and ending with a letter or digit. Two services cannot share one. |
services[].repo | The repository the service is built from, like github.com/acme/shop. Left out, it is the repository the file is in. |
services[].root | The folder of the repository the service lives in. It is the build's context, for a buildpack and for a Dockerfile. It must stay inside the repository. Left out, it is the root. |
services[].build | buildpack or dockerfile. Left out, a buildpack, or a Dockerfile when dockerfile is set. With no file, Clusterz proposes the Dockerfile it finds. |
services[].dockerfile | With build: dockerfile, the Dockerfile's path from root. Left out, Dockerfile. It cannot be set with build: buildpack. |
services[].build_command | The command a buildpack build runs, as the npm scripts of your package, like npm run build. A Dockerfile runs its own steps, so the file refuses it with build: dockerfile. |
services[].start_command | The command that starts the service. Left out, the buildpack's or the image's own. |
services[].release_command | A command that runs once for each deploy, after the build and before traffic moves, with the service's variables. If it fails, the deploy stops and the running version stays up. Use it for migrations. |
services[].type | What the service is. web is the one service at the app's address and its custom domains; an app has at most one. api is a service the app's other services call, private unless it says public. worker listens on no port: it has no address, and its health check is that it keeps running. A file of one service may leave it out, and that service is the web. A file of several names every service's type. |
services[].port | The port the service listens on, from 1 to 65535, given to it as PORT. Left out, what its framework says, else 8080. A worker takes none. |
services[].worker | The older spelling of type: worker, still read. Beside another type it is refused. |
services[].public | An api gets its own address under the app's, api.shop.acme.clusterz.eu, once that name resolves to Clusterz. Without it, only the app's services reach it. A web has the app's address already, and a worker has none, so neither takes it. |
services[].health_check | The path asked once the service starts. It starts with /. Left out, /health. |
services[].size | What each instance has and how many run. |
services[].size.memory_gb | Memory for each instance, in GB, from 0.125 to 256. |
services[].size.vcpu | CPU for each instance, in vCPU. |
services[].size.instances | How many instances run. |
A build command, a start command and a release command are each one line.
The app's own settings
One service keeps the app's own settings: the variables set without naming a service, its volumes and its build history. A new app gives them to its web, or to its first service when it has no web. The app keeps them on that service wherever the file lists it and whatever its type. If that service leaves the file, they pass to the web, and the plan says so before anything changes.
Every other service starts its name with a letter, and cannot be called app or release, nor a name the database's own services use: postgres, auth, rest, storage or realtime.
Its variables are described in Variables in the file.