-
Notifications
You must be signed in to change notification settings - Fork 138
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
Define/influence generated PV names #814
Comments
ONLY
|
Great! thanks @andyzhangx, I'll take a look! |
@andyzhangx sorry but I might be misunderstanding something. for chart version ~1.9, the controller isn't creating a new My ---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: smb
namespace: {{ .Release.Namespace }}
provisioner: smb.csi.k8s.io
parameters:
source: {{ .Values.smb.host }}
csi.storage.k8s.io/provisioner-secret-name: {{ .Values.smb.credsName | default "smbcreds" }}
csi.storage.k8s.io/provisioner-secret-namespace: {{ .Release.Namespace }}
csi.storage.k8s.io/node-stage-secret-name: {{ .Values.smb.credsName | default "smbcreds" }}
csi.storage.k8s.io/node-stage-secret-namespace: {{ .Release.Namespace }}
reclaimPolicy: Retain # available values: Delete, Retain
volumeBindingMode: Immediate
mountOptions:
- dir_mode=0777
- file_mode=0777
- uid=1001
- gid=1001 I tried adding it as a parameters:
subDir: ${pvc.metadata.name}--${pvc.metadata.namespace}/${pv.metadata.name} note the
overall though, this doesn't really suit my needs. what I would really like to do is to pass in parameters from the So in a separate namespace I have this ---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: smb-pvc
namespace: smb-pvc-example
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Mi
storageClassName: smb The documentation that you linked states that I can use Ideally I would like to define the name of the generated ---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: smb-pvc
namespace: smb-pvc-example
# THIS is effectively what I want
labels:
csi.storage.k8s.io/pv-generate-name: ${pvc.metadata.name}--${pvc.metadata.namespace}--<name of deployment that Im going to attach to>--${UUID}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 50Mi
storageClassName: smb is that possible at all? thanks in advance! |
@chr0n1x there is not supported in the upstream: kubernetes-csi/external-provisioner#760, and |
@andyzhangx oh that issue is closed |
I guess they're looking for contrubutors per kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#1018 . Ill close this issue, thanks for the help! |
Hello, there's nothing in the examples as far as I can see, so Im requesting here:
Would it make sense to have some way for us to define a
StorageClass
with agenerateName
annotation?I currently have the SMB driver/controller and longhorn installed. ALL PVs created by both CSI drivers start with
pvc-.....
.I'd like to have all SMB-generated PVs to be prefixed with
smb-pvc-...
instead. Ideally, for my usecases I'd like to do something like defining a naming template e.g.:generateName: "${pod.name}-smb-pvc-"
Apologies if there's already documentation for this and I missed this.
The text was updated successfully, but these errors were encountered: