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

Add an option which enables the memory optimization inside of spod daemon #1425

Merged
merged 12 commits into from
Jan 23, 2023

Conversation

ccojocar
Copy link
Contributor

@ccojocar ccojocar commented Jan 20, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Adds an option to enable memory optimization inside of spod daemon.

The controller running inside of spod daemon process is watching all pods available in the cluster when profile recording
is enabled. It will perform some pre-filtering before the reconciliation to select only the pods running on local
node as well as pods annotated for recording, but this operation takes place after all pods objects are loaded
into the cache memory of the informer. This can lead to very high memory usage in large clusters with 1000s of pods, resulting in spod daemon running out of memory or crashing.

In order to prevent this situation, the spod daemon can be configured to only load into the cache memory the pods explicitly
labeled for profile recording.

Which issue(s) this PR fixes:

Fixes #1385
Fixes #1386

Does this PR have test?

yes

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add an option to enable memory optimization inside of spod daemon.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 20, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 20, 2023
@ccojocar
Copy link
Contributor Author

/assign @saschagrunert

@ccojocar
Copy link
Contributor Author

/test all

1 similar comment
@ccojocar
Copy link
Contributor Author

/test all

@codecov-commenter
Copy link

Codecov Report

Merging #1425 (0947ea9) into main (1d837ee) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
- Coverage   44.17%   44.13%   -0.04%     
==========================================
  Files          50       50              
  Lines        5646     5651       +5     
==========================================
  Hits         2494     2494              
- Misses       3032     3037       +5     
  Partials      120      120              

@JAORMX
Copy link
Contributor

JAORMX commented Jan 20, 2023

very nice! It looks good to me. I'll merge this once CI passes.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 23, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ccojocar, saschagrunert

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2023
@saschagrunert
Copy link
Member

Thank you!

@k8s-ci-robot k8s-ci-robot merged commit 3e42cf0 into kubernetes-sigs:main Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
5 participants