What does Helm's --history-max control, and what does exceeding it remove?
answer
- A bound on how many records survive
- Its default is a small round number
- Trimming deletes records, never running objects
- What disappears is a rollback target
- Passed per command, not stored on the release
basics
~20 sIt caps how many revision records Helm keeps for one release, defaulting to 10. When an upgrade exceeds the cap, Helm deletes the oldest records, so those revisions leave helm history and can no longer be rolled back to.
solid answer
~50 sEvery `helm upgrade` writes a new revision record and then trims the release's history to `--history-max`, which defaults to 10; `0` means keep everything. Trimming deletes the oldest records for that release — nothing about the deployed objects changes, and revision numbers keep climbing rather than being reused, so a release at revision 214 with a cap of 10 has records v205 through v214. The consequence people miss is that pruning destroys rollback targets: `helm rollback 3` on that release fails because revision 3's record is gone, and with it the chart, values and manifest that revision would have restored. The cap is per command invocation, not a property stored on the release, so if a pipeline passes it and an engineer's ad-hoc upgrade does not, the release silently reverts to the default of 10.
code
bash · 2 lineshelm upgrade gateway ./telemetry-gateway -n telemetry --history-max 25
helm history gateway -n telemetrygo deeper
Remember that Helm keeps a bounded number of revision records per release, that the default is 10, and that helm history shows only what survives. Knowing the default number is most of what is asked at this level.
Explain the mechanics: an upgrade writes the new record then trims the oldest, numbering never resets, and the thing you lose is the ability to roll back to a trimmed revision. Say clearly that no live object is affected.
Tie the number to a detection window and to storage cost — record size times retention times release count — and point out that the flag is per invocation, so one manual upgrade without it silently trims a carefully raised history.
Set the policy: what rollback horizon the organisation is buying, where the number is enforced so no deploy path can bypass it, and where the durable record of what shipped lives, given that release history is a rollback buffer rather than an audit log.
### What the limit does Each revision of a release is a separate record object, and each record embeds a full copy of the chart, the supplied values and the rendered manifest. Left unbounded, a release that is upgraded on every merge accumulates one such record per deploy forever. `--history-max` is the bound: after a new revision is written, Helm deletes the oldest records for that release until at most that many remain. The default is 10, and `0` disables trimming entirely. Two details matter for reading `helm history` correctly. First, revision numbers are monotonic — trimming does not renumber anything, so history's lowest revision simply climbs over time. A telemetry ingest gateway deployed 214 times under the default shows revisions 205 to 214, not 1 to 10. Second, trimming touches only Helm's records. No Deployment is deleted, no rollout is triggered, nothing about the running system notices. ### What you actually lose The stored record is the entire basis for rolling back: `helm rollback N` reads revision N's record and re-applies the chart, values and manifest it holds. Delete the record and there is nothing to roll back to. So the retention number is not a housekeeping preference — it is literally how far back you can go. A cap of 3 on a service that deploys ten times a day means your rollback horizon is about twenty minutes of deploy activity, and a bad change discovered the next morning has no stored good revision to return to. That is the tension the question is really about. Small numbers keep the cluster's datastore healthy but shorten the safety net; large numbers preserve the safety net and multiply the storage each release consumes, since every retained revision carries its own chart copy. The reasonable posture is to size retention against how quickly you would realistically detect a bad deploy, and to notice that the answer differs between a batch job upgraded twice a year and a gateway upgraded hourly. ### It is a flag, not a setting `--history-max` is passed per invocation. It is not recorded on the release, and there is nothing in the release that remembers what the last caller asked for. The practical failure this produces: a CI pipeline standardises on `--history-max 30`, an engineer runs a manual `helm upgrade` during an incident without it, and that one command trims the release back to the default of 10 — quietly deleting twenty revisions of rollback history at the exact moment history is most valuable. If you care about the number, it goes in the wrapper script or the deploy template that every path uses, including the break-glass one. The same invocation-scoped nature means changing your mind is cheap in one direction and not the other: raising the cap only takes effect for revisions that still exist, because the ones already trimmed are gone for good. ### Why the numbers add up faster than expected Because the record embeds the chart, the size of one revision is driven by what the chart carries, not by what changed. Upgrading with a single value flipped — say raising a hook timeout to 96 seconds — writes a record just as large as the initial install, since the chart and rendered manifest are stored again in full. A large umbrella chart with subcharts can produce records of several hundred kilobytes each, and ten of those, times a few hundred releases, is a real number in the cluster's datastore. Compression helps enormously and is already applied, but it does not change the shape: cost is roughly (record size) × (retention) × (releases). That gives you two independent levers, and it is worth being clear that they solve different problems. Retention controls the *number* of records, and is the right lever for datastore pressure across an estate. It does nothing whatever for a *single* record that is too large to be written at all — that ceiling is per object, and trimming history to three will not make revision 8 fit. ### Operationally Set retention deliberately, once, in the path everyone deploys through. Pick it from your detection window rather than from a round number. Expect `helm history` to show a sliding window rather than the beginning of time, and do not treat that window as an audit trail — it is a rollback buffer that will be trimmed by the next few deploys. If you need the record of what was deployed and when to survive longer than that, it belongs somewhere outside the release store.
- A release shows revisions 205 through 214 in helm history. Why does it not start at 1?Because retention trimmed the older records while revision numbering kept climbing. Helm never reuses or renumbers revisions: the counter increments on every upgrade and rollback, and the default cap of 10 simply means only the ten most recent records still exist. The gap is normal, not corruption, and it tells you the release has been upgraded at least 214 times.
- Your estate is straining the cluster datastore because of release records. Does lowering --history-max fix a single release whose record is too large to write?No — the two problems are separate. Retention controls how many records exist and is the right lever for total pressure across many releases. A record that is rejected because it exceeds the per-object size limit fails on its own size, and it will keep failing with a cap of three, of one, or of zero. That one is fixed by shrinking what the chart carries, splitting the release, or changing the storage backend.
- Where should the retention number be configured for a team?In the single wrapper, deploy template or base image that every path goes through — including manual and break-glass paths. Because the flag is per invocation and is not remembered by the release, one ad-hoc upgrade without it trims the release straight back to the default of 10, which is precisely the scenario in which someone is about to want a deep rollback.
saying these in an interview costs you the question
- Thinks trimming history deletes or restarts running workloads
- Believes revision numbers are renumbered after pruning
- Assumes the limit is stored on the release, not per command
- Says raising the cap can bring pruned revisions back
- Confuses the record count limit with the per-record size limit
- Treats helm history as a durable audit trail