Repository navigation
Optimize helm list to reduce bandwidth with metadata-only requests - #4376
Open
torbjornvatn wants to merge 2 commits into
Open
torbjornvatn wants to merge 2 commits into
torbjornvatn wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4375