Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[helm_resources_manager] use cache instead of a plain client #514

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

miklezzzz
Copy link
Contributor

@miklezzzz miklezzzz commented Oct 17, 2024

Overview

Currently, helm resources manager creates a resources monitor for every enabled module that has a helm release. In its turn, a resource monitor periodically checks whether all the resource of the corresponding helm release are presented in the cluster. These checks are performed by retrieving partial metadata for every object of the release via List operation. The main gist of the PR is to get objects' metadata not from the cluster API directly, but rather from the cache, decreasing amount of List operations and speeding up some of the operations related to helm releases (checking if a helm release should be applied, running periodic checks for absent resources).

What this PR does / why we need it

  • Helm resources manager gets a cache and shares it with resource monitors it creates.
  • The cache has labelSelector filter that should help cache only related objects (objects, deployed by the addon-operator).
  • In order to tell the difference between related and not related objects, a post-renderer was introduced.
  • The post-renderer applies an additional label (heritage=addon-operator by default, yet configurable) to every resource the operator deploys (see helm post-renderer functionality).
  • The post-renderer is supported by both helm3 and helm3lib implementations (with quite noticeable discrepancies in realizations, so using helm3 is discouraged due to operational overhead).

Special notes for your reviewer

@miklezzzz miklezzzz added the enhancement New feature or request label Oct 17, 2024
@miklezzzz miklezzzz self-assigned this Oct 17, 2024
@miklezzzz miklezzzz force-pushed the resource-informer-use-cache branch 2 times, most recently from b9bce8d to f646dd5 Compare October 17, 2024 13:31
@miklezzzz miklezzzz changed the title Resource informer with cache [helm_resources_manager] use cache instead of a simple client Oct 17, 2024
@miklezzzz miklezzzz changed the title [helm_resources_manager] use cache instead of a simple client [helm_resources_manager] use cache instead of a plain client Oct 17, 2024
@miklezzzz miklezzzz marked this pull request as ready for review October 17, 2024 15:36
@miklezzzz miklezzzz force-pushed the resource-informer-use-cache branch 4 times, most recently from 9e509c6 to 024f1d6 Compare October 21, 2024 15:23
Signed-off-by: Mikhail Scherba <[email protected]>
Signed-off-by: Mikhail Scherba <[email protected]>
@yalosev yalosev merged commit c81d815 into main Oct 24, 2024
8 checks passed
@yalosev yalosev deleted the resource-informer-use-cache branch October 24, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants