-
Notifications
You must be signed in to change notification settings - Fork 338
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
Replace templates in SC parameter with PVC annotations #808
Conversation
Hi @vinli-cn. 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. Instructions 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vinli-cn The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
@vinli-cn could you add more details in PR description? thanks. |
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.
pls add ut for this PR, and also I found resolveTemplate
does not have any ut, I think you could submit a separate PR for resolveTemplate ut
@xing-yang could you take a look? this is actually a requirement from smb csi driver, user wants to use
e.g.
|
/assign @xing-yang |
In the past, we have rejected enhancement requests like this for portability reasons. I think we need to have a discuss on this. |
See this issue here: #86 |
@xing-yang this is not Adding PVC's annotation to CreateVolumeRequest.Parameters, and since kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fast-storage
provisioner: csi-driver.team.example.com
parameters:
type: pd-ssd
csi.storage.k8s.io/node-publish-secret-name: ${pvc.annotations['team.example.com/key']}
csi.storage.k8s.io/node-publish-secret-namespace: ${pvc.namespace} |
As Andy mentioned above, external-provisioner can replace templates in secret parameters in Storage Class with values from PVC annotations already, and this PR extends similar "translation" for other parameters in Storage Class, eg: ${pvc.annotations['subDirInPVC']} in my example. We've seen lots of user cases from community. This PR doesn't have any correlation with #86. In fact, I've sent below PR for similar issue in #86 but it's being discussed now. |
I understand that passing annotations (or any other per-PVC configuration) to CSI driver can have mane useful use cases and is frequently asked for, my personal favorite is a way to tag volumes in a cloud by user (PVC author) provided tags. However, it's a double edged sword.
Not that I'd like to have some way how to pass custom parameters from PVC to PV and to CSI driver, however, it must be done carefully. I don't have a magic solution that would solve both problems mentioned above, but it may exist. |
@jsafrane thanks for the comments. Regrading to point 1 & 2, I am thinking is it possible to add a feature flag for this feature(by default disable), so if users want this feature, they could turn it on in csi-provisioner themselves, by that way, this feature won't affect all csi-provisioner users, and it could also satisfy specific csi driver users. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions 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. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Replace templates in SC parameter with PVC annotations, this fixes issue 428 in csi-driver-smb repo: kubernetes-csi/csi-driver-smb#428
This change has been tested manually with SMB CSI Driver which uses SC parameter subDir in SMB mount path, code example as below
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: