datashim icon indicating copy to clipboard operation
datashim copied to clipboard

Add custom metadata

Open tvanderwal-lmco opened this issue 2 years ago • 2 comments

Is there anyway to add in additional labels/annotations on the Dataset CRD to get added to the PersistentVolumeClaim that get's allocated for it? We use labels to allow our users to view and attach volumes to their workloads however the Datashim volumes get missed if the PVC isn't manually labelled by the creator.

tvanderwal-lmco avatar Feb 27 '23 16:02 tvanderwal-lmco

@tvanderwal-lmco Currently, we don't have a way to do this but this would be a good feature to have. Can you sketch how this would look like in terms of YAMLs ? Also, happy to consider a PR if you would like to contribute :-)

srikumar003 avatar Mar 01 '23 12:03 srikumar003

That's awesome! It might be a while until I can get a PR approved through our process but I could get that started if needed. I was thinking it could either be as simple as applying any labels on the dataset to the PVC, or it could be an additional part of the spec. I think either approach would be easy to use but the first would make it easy to query all objects for that label and get both the Dataset and PVC

apiVersion: com.ie.ibm.hpsys/v1alpha1
kind: Dataset
metadata:
  name: labelled-dataset
  labels:
    team: group-1
  namespace: default
spec:
  local:
    accessKeyID: MyKey
    bucket: MyBucket
    endpoint: MyEndpoint
    region: ""
    secretAccessKey: MySecretKey
    type: COS

or

apiVersion: com.ie.ibm.hpsys/v1alpha1
kind: Dataset
metadata:
  name: labelled-dataset
  namespace: default
spec:
  volumeLabels:
    team: group-1
  local:
    accessKeyID: MyKey
    bucket: MyBucket
    endpoint: MyEndpoint
    region: ""
    secretAccessKey: MySecretKey
    type: COS

tvanderwal-lmco avatar Mar 02 '23 04:03 tvanderwal-lmco