Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify that rollout revision is only created when pod template is changed #354

Merged
merged 1 commit into from
Apr 8, 2016
Merged
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
11 changes: 10 additions & 1 deletion docs/user-guide/deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ before changing course.

## Rolling Back a Deployment

Sometimes we may want to rollback a Deployment; for example, when the Deployment is not stable, such as crash looping.
Sometimes you may want to rollback a Deployment; for example, when the Deployment is not stable, such as crash looping.
By default, all of the Deployment's rollout history is kept in the system so that you can rollback anytime you want
(you can change that by specifying [revision history limit](/docs/user-guide/deployments/#revision-history-limit)).
You should note that only the update to the Deployment's "pod template" is seen as a different revision of rollout.

Suppose that we made a typo while updating the Deployment, by putting the image name as `nginx:1.91` instead of `nginx:1.9.1`:

Expand Down Expand Up @@ -285,6 +288,8 @@ Events:

To fix this, we need to rollback to a previous revision of Deployment that is stable.

### Checking Rollout History of a Deployment

First, check the revisions of this deployment:

```shell
Expand All @@ -309,6 +314,8 @@ Image(s): nginx:1.9.1
No volumes.
```

### Rolling Back to a Previous Revision

Now we've decided to undo the current rollout and rollback to the previous revision:

```shell
Expand All @@ -323,6 +330,8 @@ $ kubectl rollout undo deployment/nginx-deployment --to-revision=2
deployment "nginx-deployment" rolled back
```

For more details about rollout related commands, read [`kubectl rollout`](/docs/user-guide/kubectl/kubectl_rollout/).

The Deployment is now rolled back to a previous stable revision. As you can see, a `DeploymentRollback` event for rolling back to revision 2 is generated from Deployment controller.

```shell
Expand Down