Use a custom volume name in GKE auto-provisioned PersistentVolumeClaim

Viewed 86

I'm using auto-provisioned volumes with PVC in Google Kubernetes Engine like this

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-test-pvc1
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: standard-rwo
  resources:
    requests:
      storage: 10Gi

And it's working fine.

$ kubectl get pvc
NAME                   STATUS   VOLUME                                     ...
my-test-pvc1           Bound    pvc-75025c65-8770-49c9-9d85-9c8ed61a3862   ...
my-test-pvc2           Bound    pvc-85a6edfa-5890-4641-bfee-721d3efc0f74   ...
my-test-pvc3           Bound    pvc-532365ef-621d-4e80-9523-7a6ec520f16c   ...

The volumes are automatically provisioned with a pvc-XXXXXXXX-XXXX-.... naming scheme.

My question is: is it possible to influence those pvc-... volume names somehow to make them more descriptive? So that I can see what the volumes are for when I look at them in the GCE console compute/disks page.

I've tried adding volumeName: my-test-pv1 to the PVC spec, but that breaks auto-provisioning, i.e. nothing is provisioned anymore.

0 Answers
Related