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

fix(cert-manager): exclude CRDs from cache to avoid excessive memory usage #2258

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

bacherfl
Copy link
Member

Closes #2257

This PR disables the cache for CustomResourceDefinitions in the certificate-operator. The reason for that change is to prevent OOMKills in the certificate operator, as when caching is enabled for a certain resource, all existing objects of that resource are retrieved initially and stored in an internal cache. This can be a problem especially for CRDs, which can be particularly large. Also, this means that the memory usage of the operator will be directly affected by the number of CustomResourceDefinitions in the cluster. In my case this caching behavior this lead to either the operator running into OOMKills, or taking over a minute for handling the retrieval of CRDs (if the memory limit has been increased).

@netlify
Copy link

netlify bot commented Oct 10, 2023

Deploy Preview for keptn-lifecycle-toolkit ready!

Name Link
🔨 Latest commit bc24a3f
🔍 Latest deploy log https://app.netlify.com/sites/keptn-lifecycle-toolkit/deploys/6525414043eb990008a8548f
😎 Deploy Preview https://deploy-preview-2258--keptn-lifecycle-toolkit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #2258 (2ff6dec) into main (e89ea71) will decrease coverage by 10.61%.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2258       +/-   ##
===========================================
- Coverage   84.61%   74.01%   -10.61%     
===========================================
  Files         154       80       -74     
  Lines        9960     5226     -4734     
===========================================
- Hits         8428     3868     -4560     
+ Misses       1245     1142      -103     
+ Partials      287      216       -71     
Files Coverage Δ
...okcontroller/keptnwebhookcertificate_controller.go 53.89% <100.00%> (+8.50%) ⬆️

... and 86 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 67.19% <100.00%> (+1.28%) ⬆️
component-tests 58.10% <ø> (ø)
lifecycle-operator ?
metrics-operator 87.55% <ø> (ø)
scheduler 32.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Signed-off-by: Florian Bacher <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bacherfl bacherfl marked this pull request as ready for review October 10, 2023 12:54
@bacherfl bacherfl requested a review from a team as a code owner October 10, 2023 12:54
@bacherfl bacherfl merged commit 5176a4c into keptn:main Oct 11, 2023
38 of 39 checks passed
@bacherfl bacherfl deleted the fix/cert-resource-consumption branch October 11, 2023 05:54
StackScribe pushed a commit to StackScribe/lifecycle-toolkit that referenced this pull request Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Certificate operator resource consumption exceeding limits
3 participants