Replicas
A replica is one running copy of a service: one container on one of your servers. A service runs 1 to 100 replicas. More than one needs the load balancer on a public service, and is not allowed on a private service or one with a volume.
Where replicas are placed
You choose the servers a service may run on. At each deploy its replicas are spread over them in turn, in a fixed order (by the servers' ids), so the same settings always place the same way:
| Servers chosen | Replicas | Placed |
|---|---|---|
| 1 | 3 | All three on that server |
| 2 | 3 | Two on the first server, one on the second |
| 3 | 3 | One on each |
A server that has been disconnected is skipped. A service with a volume runs on its volume's server only; see Volumes.
A service built from Git on several servers
A Git service placed on more than one server is built once, pushed to your organization's own registry, and pulled from it by every server it is placed on. The registry travels over the private network, so every one of those servers must be in it: OpenPanel refuses such a deploy while one of them is not, for example a server added with One command. A service that runs a Docker image is pulled from its registry on every server and can span any of them.
Change how many
openpanel services update web --project shop --replicas 4 --server eu-1 --server eu-2
openpanel deploy web --project shop--server replaces the list of servers: name every server the service may use.
The new count takes effect at the next deploy.
How a deploy replaces them
On each server, the OpenPanel agent rolls its own replicas:
New replicas start beside the old ones
The old replicas keep serving.
The edge moves to the new ones
From the moment a new replica is ready, the edge sends traffic only to new replicas.
The old ones stop
Once every new replica on that server is ready, the agent waits 5 seconds for requests in flight to finish, then stops the old ones.
If a new replica exits or fails its health check, the old ones keep serving until OpenPanel marks the deployment failed and gives the service back to the deployment before it. See Health checks.
A service with a volume is the exception: its one replica stops before the new one starts.
Reaching a replica
From outside, a public service's replicas are reached only through the edge, never directly: your servers publish no container port. Inside a project, other services on the same server reach the service by its name.