-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: add key management provider resource #1293
feat: add key management provider resource #1293
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1293 +/- ##
==========================================
+ Coverage 61.60% 64.77% +3.16%
==========================================
Files 98 104 +6
Lines 6248 5402 -846
==========================================
- Hits 3849 3499 -350
+ Misses 2066 1544 -522
- Partials 333 359 +26 ☔ View full report in Codecov by Sentry. |
85c450d
to
97c95f9
Compare
dd5d5ad
to
8805eff
Compare
854007d
to
0e1c500
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, left some clarification questions
@@ -8,7 +8,7 @@ spec: | |||
parameters: | |||
verificationCertStores: | |||
certs: | |||
- certstore-akv | |||
- kmprovider-akv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a new CR, i m thinking if we can enforce "namespace must of provided". Since kmprovider is a namespace resource, we won't have to guess its namespace if its not specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. the challenge is when we init the verifier, we don't know if its referencing a cerstore or a kpmprovider. Wondering if there is a way to enforce namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure want to make the user always append namespace in front? I think the only scenario where a user would refere to a KMP outside the verifier's namespace is if they are referring to a clusterred KMP which would be introduced for multitenancy. I see that right now the verifier is cluster scoped. But I also see that there is previous functionality to get the cert store namespace and then append it if not present. https://github.com/deislabs/ratify/blob/8acc7f2091f8dd430d759a7e5505c54ded5b0e56/pkg/controllers/verifier_controller.go#L165
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flow that I see already for certificate store is: 1. check if the resource has a namespace. 2. if not check if the ratify namespace env var is set. 3. when creating the notation verifier, append the namespace to the front of the certstore ref if one is not already provided.
For KMP, should we just follow the same behavior? I added a check in the notation trust store to check both the certificate store's certificate map as well as the KMP equivalent so there shouldn't be any ambiguity as to if its a KMP resource or a legacy Certificate Store.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Akash and I had a offline discussion and agreed on KMP provider to mirror the CertStore behavior for this PR. We should find another time to discussion the levels of namespace enforcement as a part of Multi tenancy work.
our goal:
- intuitive and deterministic user experience.
- Straightforward application logic.
We want to review the valid combination of we should support and validate. Cluster Verifiers (Cluster certStore, Namespaced certStore ) and Namespaced Verifiers (Cluster certStore, Namespaced certStore ). cc @binbin-li
Hi@akashsinghal , would you be able to add some test results/ screenshots / logs so we could review what the CRs look like for back compatibility purpose? For example, for existing customers using AKV code path, on ratify upgrade, will they see both CertStore and KMP CR? From the code, one CR (hopefully they reconcile in a deterministic fashion ), should be in a disabled with a clear msg ( might need doc to clarify this is expected for existing customer). |
@susanshi, @binbin-li, and I had a discussion offline about this. The goal is to transition users to use the new KeyManagementProvider (KMP) resource without breaking them. New users ideally should be installing KMP instead of CertificateStore. For upgrade scenarios, users would already have an existing CertificateStore resource on a cluster and we cannot force the user to update while causing potential Ratify downtime. Introducing KMP should not be a breaking change initially until v2.0.0. As such, here is the proposed approach:
Documentation and TODOs will be added with above behavior Here's a sample of logs when a user updates to newer version of Ratify from current version:
|
Community Meeting 3/20/24 discussion:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I m happy for this PR to merge as this to unblock the series of cosgin work. As long as we don't release, we have time discuss and update the compat story.
@susanshi appreciate another round of review. From your last review: I updated an error message to be more descriptive. I switched the behavior so that now a |
Description
What this PR does / why we need it:
Certificate Store
CertificateStore
andKeyManagementProvider
resources together.CertificateStore
resources.CertificateStore
resources, users should migrate to the equivalentKeyManagementProvider
.KMP
resources when a matchingCertificateStore
with same name is found.Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #1294
Type of change
Please delete options that are not relevant.
main
branch)How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Checklist:
Post Merge Requirements
Helm Chart Change