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

kmsv2: implement expire cache with clock #113121

Merged
merged 1 commit into from Jan 26, 2023

Conversation

aramase
Copy link
Member

@aramase aramase commented Oct 17, 2022

Signed-off-by: Anish Ramasekar anish.ramasekar@gmail.com

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Use expiring cache for KMS v2
    • The default TTL for cache entry is set to 1h

Which issue(s) this PR fixes:

Fixes #111920

Special notes for your reviewer:

Does this PR introduce a user-facing change?

cacheSize field in EncryptionConfiguration is not supported for KMSv2 provider

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

[KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-auth/3299-kms-v2-improvements

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 17, 2022
@aramase
Copy link
Member Author

aramase commented Oct 17, 2022

/sig auth
/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added sig/auth Categorizes an issue or PR as relevant to SIG Auth. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 17, 2022
@aramase
Copy link
Member Author

aramase commented Oct 17, 2022

/assign @enj
/hold

(work in progress)

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Oct 17, 2022
@@ -107,32 +109,29 @@ func newTestEnvelopeService() *testEnvelopeService {
func TestEnvelopeCaching(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

I am trying to think of how we can more rigorously test the new cache type...

@k8s-ci-robot k8s-ci-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Oct 18, 2022
@aramase
Copy link
Member Author

aramase commented Nov 1, 2022

/cc @mikedanese

@mikedanese Could you take a look at the PR when you get a chance?

@enj enj added this to Needs Triage in SIG Auth Old Nov 14, 2022
@aramase aramase changed the title kmsv2: implement expiring cache kmsv2: implement lru expire cache with clock Jan 12, 2023
@aramase
Copy link
Member Author

aramase commented Jan 23, 2023

@enj had to push an update removing cacheSize from one of the new added integration tests, need another lgtm 😄

@aramase
Copy link
Member Author

aramase commented Jan 23, 2023

/retest

@enj
Copy link
Member

enj commented Jan 23, 2023

/lgtm

@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

LGTM label has been added.

Git tree hash: 64959e0aa32767996bdfe0cb4a8f670362d9537a

@aramase
Copy link
Member Author

aramase commented Jan 24, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 24, 2023
@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

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

Talked offline with @aramase and @enj

Before beta, I think kms v2 should have some capability for coasting with an offline kms grpc (e.g. a minimum cache size), but can be added in a follow-up.

During beta, we could evaluate whether that minimum cache size needed to be user tunable

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 25, 2023
@aramase
Copy link
Member Author

aramase commented Jan 25, 2023

@liggitt thanks for the review. Updated the PR!

@liggitt
Copy link
Member

liggitt commented Jan 25, 2023

config file API bits lgtm, CI is having unrelated issues due to python2/python3 migrations at the moment...

@liggitt liggitt added this to API review completed, 1.27 in API Reviews Jan 25, 2023
@liggitt
Copy link
Member

liggitt commented Jan 25, 2023

/approve
for API bits

/lgtm
per @enj's earlier review

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

LGTM label has been added.

Git tree hash: 6058ce61fbc066e84a8821b32e23487e6ba7fa36

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aramase, enj, liggitt

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 25, 2023
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit fab126d into kubernetes:master Jan 26, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.27 milestone Jan 26, 2023
@aramase aramase deleted the expiring-cache branch January 26, 2023 03:17
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. area/apiserver area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.27
Archived in project
Status: Done
SIG Auth Old
Needs Triage
Development

Successfully merging this pull request may close these issues.

[KMSv2] Use expiring cache
5 participants