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

Scope secrets cache to single namespace #972

Merged
merged 2 commits into from
Nov 19, 2020

Conversation

shomron
Copy link
Contributor

@shomron shomron commented Nov 18, 2020

Incorporate open-policy-agent/cert-controller#16 to avoid caching
cluster-wide secrets in certificate rotation controller. This will
reduce the memory consumption of Gatekeeper on clusters with a large
number of secrets defined.

Fixes #831

Signed-off-by: Oren Shomron shomron@gmail.com

Special notes for your reviewer:
Tests for this change can be found in the cert-controller repo. However, we should probably expand the tests we have to verify main.go stitches everything together properly.

Incorporate open-policy-agent/cert-controller#16 to avoid caching
cluster-wide secrets in certificate rotation controller. This will
reduce the memory consumption of Gatekeeper on clusters with a large
number of secrets defined.

Fixes: open-policy-agent#831

Signed-off-by: Oren Shomron <shomron@gmail.com>
@codecov-io
Copy link

codecov-io commented Nov 18, 2020

Codecov Report

Merging #972 (1f4758a) into master (624bfcc) will increase coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #972      +/-   ##
==========================================
+ Coverage   46.38%   46.64%   +0.26%     
==========================================
  Files          56       56              
  Lines        3454     3454              
==========================================
+ Hits         1602     1611       +9     
+ Misses       1645     1640       -5     
+ Partials      207      203       -4     
Flag Coverage Δ
unittests 46.64% <ø> (+0.26%) ⬆️

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

Impacted Files Coverage Δ
pkg/readiness/ready_tracker.go 69.81% <0.00%> (+0.72%) ⬆️
...onstrainttemplate/constrainttemplate_controller.go 55.70% <0.00%> (+2.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 624bfcc...1f4758a. Read the comment docs.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@maxsmythe maxsmythe merged commit 688b17d into open-policy-agent:master Nov 19, 2020
shomron added a commit to shomron/gatekeeper that referenced this pull request Nov 25, 2020
Incorporate open-policy-agent/cert-controller#16 to avoid caching
cluster-wide secrets in certificate rotation controller. This will
reduce the memory consumption of Gatekeeper on clusters with a large
number of secrets defined.

Fixes: open-policy-agent#831

Signed-off-by: Oren Shomron <shomron@gmail.com>

Co-authored-by: Max Smythe <smythe@google.com>
shomron added a commit to shomron/gatekeeper that referenced this pull request Nov 25, 2020
Incorporate open-policy-agent/cert-controller#16 to avoid caching
cluster-wide secrets in certificate rotation controller. This will
reduce the memory consumption of Gatekeeper on clusters with a large
number of secrets defined.

Fixes: open-policy-agent#831

Signed-off-by: Oren Shomron <shomron@gmail.com>

Co-authored-by: Max Smythe <smythe@google.com>
shomron added a commit that referenced this pull request Dec 1, 2020
#982)

* Allow multiple webhooks to be created (#882)

The PR prepares gatekeeper to be able to create multiple
webhooks. Common webhook code was extracted to a separate
file, and an update to cert rotator is used that allows
to update multiple webhooks.

Tested:
Gatekeeper with the changes was run. An incoming resource
was successfuly denied request due to gatekeeper policy.

Signed-off-by: mmirecki <mmirecki@redhat.com>
Signed-off-by: Oren Shomron <shomron@gmail.com>

Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>

* Scope secrets cache to single namespace (#972)

Incorporate open-policy-agent/cert-controller#16 to avoid caching
cluster-wide secrets in certificate rotation controller. This will
reduce the memory consumption of Gatekeeper on clusters with a large
number of secrets defined.

Fixes: #831

Signed-off-by: Oren Shomron <shomron@gmail.com>

Co-authored-by: Max Smythe <smythe@google.com>

* Fix e2e test flakiness (#964)

* Fix e2e test flakiness

Signed-off-by: Max Smythe <smythe@google.com>
Signed-off-by: Oren Shomron <shomron@gmail.com>

Co-authored-by: Marcin Mirecki <mmirecki@redhat.com>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
Co-authored-by: Max Smythe <smythe@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cluster-wide secret caching can lead to memory pressure
5 participants