Docs
Deploy

Apps of several services

How the services of one app get addresses, reach each other, rebuild on a push and roll back together.

Each service of an app is built from its own folder and repository, runs its own start command at its own size, and is checked on its own. One deploy builds every service, runs each release command once, then moves traffic to all of them together. The databases are started first.

Addresses

What a service is decides its address, never where it sits in the file.

webapiapi with public: trueworker
Addressshop.acme.clusterz.eu and the app's verified custom domainsnoneapi.shop.acme.clusterz.eu, once that name resolves to Clusterznone
Portport, else the framework's, else 8080, given as PORTthe samethe samenone
Health checkhealth_check asked as visitors reach it; any answer below 500 is upthe same request, from the app's own networkas for the webit keeps running
Networksthe app's own, the team's, and the one Clusterz routes overthe app's own and the team'sas for the webas for a private api

An app may have no web, as one of apis and workers does: it has no address, and the plan says "no address".

Reaching each other

Services reach each other by name on the app's own network: http://api:8080. from_service gives a service another's address: the app's address for the web, a public api's own, and the private one otherwise. The team's other apps reach a private api over the team's network.

Browsers

A private api is the smaller surface: no certificate, no cross-origin rules, nothing on the internet but the web. A browser, a phone app or another company's webhook can never reach it. Those either call the web's own server, which forwards to http://api:8080, or reach an api that says public: true.

Pushes

A push to any service's repository rebuilds and redeploys that service, and the others keep running. A push to the repository that holds clusterz.yaml reads the file again and applies what changed. Clusterz registers the push hook on every repository of the app.

Rollback

If one service fails its health check, every service goes back to the version that ran before.

Size and bill

Each service is sized on its own, and billed by its own size.

cluz services                               # each service, its state, size and address
cluz services scale web --instances 3       # one service's size; the app redeploys

The app's page shows each service with its state, its logs and its size.