Rollbacks and history
Every service keeps its deployments. A rollback makes a new deployment that runs an earlier deployment's image again.
See the history
Open the project and click the service on the canvas. Its Deployments tab lists every deployment, newest first, with its state, who or what started it, when, and how long it took. Click one to see its image or commit, the servers it ran on, and when it started and finished.
Roll back
Open the project and click the service on the canvas. On its Deployments tab, click Roll back beside an earlier deployment, then Roll back in the dialog. Only a deployment that has an image can be rolled back to.
You need deploy access to the project. A rollback rolls out like any deploy: the version that runs now keeps serving until the earlier one is ready.
The rule: the earlier image, today's settings
A rollback runs the earlier deployment's image with the service's settings and variables of today: its ports, replicas, health check, limits, start command and secrets as they are set now.
- Settings are not rolled back. If a setting broke the service, change it back, then deploy. Rolling back would carry the broken setting along.
- The service's own source is not changed. An image service still names its current tag, and a Git service still builds its branch. The next ordinary deploy runs that again. To stay on the earlier version, change the service's tag, or deploy the earlier commit with
--commit.
What can be rolled back to
| Earlier deployment | Rollback |
|---|---|
| An image deployment | Works. Your servers pull the image by its tag again, so if someone has moved the tag since, they get what it points to now. Tags you never move avoid this. |
| A Git deployment whose build succeeded | Works while the image is still on the server that built it: each server keeps the images of the newest five deployments of each service. An older image is gone, the server cannot start it, and the rollback fails after 15 minutes. Deploy that commit again with --commit instead. |
| A Git deployment whose build never finished | Refused: "That deployment was never built, so there is no image to go back to." |
When a deploy fails on its own
You do not need to roll back after a failed deploy. When a rollout fails, the service goes back to the deployment that was running before it, and on each server the old containers keep serving throughout. See A deploy or a health check fails.