How Do You Find Out what kubectl Commands Correspond with Revision Numbers in the “rollout history”?

Problem scenario
When you run a kubectl rollout history deployment foobar command, the "CHANGE-CAUSE" is empty for certain rows (revision numbers). What can you do to keep this column with useful descriptions (or relevant commands)?

Possible Solution #1
Going forward, use the --record flag when running kubectl create [deployment] or kubectl set image deployment … commands.

Possible Solution #2
Manually edit the manifest of the resource in the deployment. The source of this one is the main Kubernetes website.

Possible Solution #3
Going forward use the kubectl annotate command. See this page for more information.

Possible Solution #4 (This is related, but not strictly relevant to the question because the revision number would not appear in this instance.)
If you do not see older revisions, and want to see more history, remember that there is a configurable limit. revisionHistoryLimit in the deployment resource is set to a default value of 10 (according to this external site). You can change this value. Here is an example of changing the value.

Leave a comment

Your email address will not be published. Required fields are marked *