feat: support PVC annotation template for provisioner secret#1196
Conversation
Provisioner can resolve templated per volume secret in storage class such as following example:
`csi.storage.k8s.io/provisioner-secret-name: ${pvc.annotations['example.com/foo_secret']}`
The secret will be stored as metadata in annotations of PV, so it can find the
secret OnDelete even the PVC was deleted
Signed-off-by: hoyho <luohaihao@gmail.com>
|
Hi @hoyho. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
The PR looks good, however, it introduces a new feature (or a bugfix). Please file release note in the PR description to advertise it to our users / CSI driver vendors. |
|
I updated the release note by myself. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hoyho, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Provisioner can resolve templated per volume secret in storage class such as following example:
csi.storage.k8s.io/provisioner-secret-name: ${pvc.annotations['example.com/foo_secret']}The secret will be stored as metadata in annotations of PV, so it can find the secret OnDelete even the PVC was deleted
What type of PR is this?
/kind feature
What this PR does / why we need it:
Inconsistent usage of per volume secrets in storage class with parameter like
csi.storage.k8s.io/provisioner-secret-nameWe can support syntax like other API does
csi.storage.k8s.io/node-publish-secret-name: ${pvc.annotations['team.example.com/key']}Which issue(s) this PR fixes:
Fixes #1148
Special notes for your reviewer:
We can use original PVC object to resolve secret during provision and store it to PV's metadata.
Parameters on existing SC are immutable so the provisioner should compatible with previous version.
Does this PR introduce a user-facing change?: