Welcome to the Linux Foundation Forum!

Revision History

In Exercise 5.4: Rolling Updates and Rollbacks, step 12 states:
In our case there are only two revisions, which is also the default number kept.

How can we override this?

Searching on "Revision History" I found
Revision History Limit - A Deployment's revision history is stored in the ReplicaSets it controls.
.spec.revisionHistoryLimit is an optional field that specifies the number of old ReplicaSets to retain to allow rollback. **
try1 has:
**revisionHistoryLimit: 10

Yet after experimenting with --record to create additional revisions, it seems that only two are kept:
$ k rollout history deployment try1
deployment.apps/try1
REVISION CHANGE-CAUSE
3
4 kubectl edit deployments.apps try1 --record=true
$ k rollout history deployment try1 --revision=1
error: unable to find the specified revision
$ k rollout history deployment try1 --revision=3
deployment.apps/try1 with revision #3
Pod Template: ....

There is an example on https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit which shows 3 items of revision history.

Comments

  • shirleydst
    shirleydst Posts: 11

    Interestingly this seemed to behave differently when I worked on something else. However it still didn't behave in a consistent way.

  • chrispokorni
    chrispokorni Posts: 2,605

    Hi @shirleydst,

    Did you happen to run several consecutive rolling updates? How many of them generated revisions in the history list?

    Regards,
    -Chris

  • shirleydst
    shirleydst Posts: 11

    I made 4 edits to the deployment's image version and although the revision history index incremented, only two items of history were listed at any point in time.

Categories

Upcoming Training