Skip to content

Optimize helm list to reduce bandwidth with metadata-only requests - #4376

Open
torbjornvatn wants to merge 2 commits into
derailed:masterfrom
torbjornvatn:master
Open

torbjornvatn wants to merge 2 commits into
derailed:masterfrom
torbjornvatn:master

Conversation

@torbjornvatn

Copy link
Copy Markdown

Fixes #4375

The helm view refreshed every 2s via `helm list`, which with the secrets
driver downloads every revision of every release (each carrying the full
compressed chart payload) from all namespaces, then discards all but the
latest. On a cluster with ~400 releases this amounted to GBs of traffic
within hours of leaving the view open.

List now issues a paginated metadata-only request for `owner=helm`
secrets and picks the latest revision per release from the name/version/
status labels. CHART, APP VERSION and the deploy time live only in the
release payload, so they are loaded in the background with at most 8
concurrent fetches and cached by secret UID + resourceVersion. Each
revision is therefore downloaded once instead of once per refresh.
Failed fetches back off for a minute and stale cache entries are pruned.

Unloaded rows render an ellipsis in the CHART and APP VERSION columns
until their details arrive. Non-secret HELM_DRIVER values and metadata
list failures fall back to the previous full `helm list` path.
Add tests for HelmChart.List backed by an httptest fake API server, so
the real metadata client and helm's secrets driver run end to end
without changing production code.

The tests lock in the behaviour that fixes the helm view bandwidth
problem:
- only the latest revision of each release is listed, using a paged
  owner=helm metadata request
- each latest revision payload is downloaded exactly once, old
  revisions are never downloaded, and later refreshes download nothing
- a changed resourceVersion triggers a single refetch and the stale
  cache entry is pruned
- failed detail fetches are not retried within the backoff window

Also cover namespace scoping (named, "all" and blank namespaces) and
the fallbacks to helm's full list on a metadata error and for
non-secret HELM_DRIVER values.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm view downloads every release revision on each refresh, causing GBs of traffic

1 participant