Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Rolling back a deployment"
linkTitle: "Rolling back a deployment"
weight: 6
description: >
This page describes when a deployment is rolled back automatically and how to manually roll back a deployment.
---

Rollbacks allow you to revert your application to a previous stable state when something goes wrong during deployment. PipeCD supports both automatic and manual rollbacks, giving you flexibility in handling deployment failures.

## Automatic rollback
You can automate rollbacks by enabling the `autoRollback` field in your application configuration:

```yaml
spec:
pipeline:
stages:
- name: K8S_CANARY_ROLLOUT
- name: K8S_PRIMARY_ROLLOUT
autoRollback: true
```

When `autoRollback` is enabled, the deployment will be rolled back if any of the following conditions are met:

- A deployment pipeline stage fails
- An analysis stage determines that the deployment has a negative impact
- An error occurs while deploying

If a rollback is triggered, PipeCD adds a new `ROLLBACK` stage to the deployment pipeline and reverts all applied changes.

## Manual rollback

If you need to roll back a deployment that has already completed, or want to intervene during a deployment which is in-progress, you can trigger a rollback manually from the Web UI. See [cancelling a deployment](./cancelling-a-deployment/) for details on how to cancel a deployment with rollback.

![Screenshot of rolling back a deployment](/images/rolled-back-deployment.png)
<p style="text-align: center;">
A deployment being rolled back
</p>