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

Improve controller-runtime cache configuration #1718

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

lburgazzoli
Copy link
Contributor

@lburgazzoli lburgazzoli commented Mar 7, 2025

Description

  • remove managed fields, as they are not used directly by the operator code
  • add Pods to the list of uncached objects because as today, we don't set any filter, hence we are caching all the Pods in a cluster
  • add Group to the list of uncached objects, since such objects are only created once
  • replace Group GET+CREATE with just CREATE since the objects are not more in the cache

How Has This Been Tested?

Screenshot or short clip

This is not a very accurate analysis, but running a controller with the small optimization introduced by the PR (blue line), seems to report a constant reduction of the memory consumption of ~ 10 MB on pretty much empty cluster

image

NAME                                                       CPU(cores)   MEMORY(bytes)   
opendatahub-operator-controller-manager-64c7594b46-9dccp   1m           173Mi     
     
NAME                                                       CPU(cores)   MEMORY(bytes)   
opendatahub-operator-controller-manager-6c655dd69d-m7scs   1m           183Mi            

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

- remove managed fields, as they are not used directly by the operator
  code
- add Pods to the list of uncached objects as they may have an high
  cardinality
- add Group to the list of uncached objects, since such objects are only
  created once
@openshift-ci openshift-ci bot requested review from robotmaxtron and ugiordan March 7, 2025 12:08
@lburgazzoli lburgazzoli requested review from grdryn and zdtsw and removed request for robotmaxtron March 7, 2025 12:14
@openshift-ci openshift-ci bot added the lgtm label Mar 7, 2025
Copy link

openshift-ci bot commented Mar 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zdtsw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Mar 7, 2025
@lburgazzoli
Copy link
Contributor Author

/test opendatahub-operator-e2e

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 23.60%. Comparing base (0145664) to head (8e654e5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
controllers/dscinitialization/utils.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1718      +/-   ##
==========================================
+ Coverage   23.59%   23.60%   +0.01%     
==========================================
  Files         171      171              
  Lines       11651    11646       -5     
==========================================
  Hits         2749     2749              
+ Misses       8627     8622       -5     
  Partials      275      275              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-merge-bot openshift-merge-bot bot merged commit 6b2dcfc into opendatahub-io:main Mar 7, 2025
10 checks passed
@lburgazzoli lburgazzoli deleted the cache-tune-1 branch March 7, 2025 15:46
lburgazzoli added a commit to lburgazzoli/opendatahub-operator that referenced this pull request Mar 7, 2025
* feat: tune controller-runtime cache

- remove managed fields, as they are not used directly by the operator
  code
- add Pods to the list of uncached objects as they may have an high
  cardinality
- add Group to the list of uncached objects, since such objects are only
  created once

* chore: replace Group GET+CREATE with just CREATE

(cherry picked from commit 6b2dcfc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants