How to set volume name on Helm install in Kubernetes DO-block storage


I am using Helm to manage installing new services in Kubernetes. I am using DO-block storage, and when I install a new site I automatically create a RWO volume to my pod to attach to.

I cannot however for the life of my understand how I can name my volumes. As I have atleast 50+ websites, it is nice to have a naming convention on them. Yes, I know that I see which services they are attached to etc, but reading the name “pvc-fadf4420-1f77-4fasc-8gg9b-df333eee75f49” in my Digital Ocean admin panel does not tell me much. I would like to name the volume “URL-pvc” for now. Is this possible to specify in the Helm chart?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@jehansstorvik The name is derived from the value of the name key within metadata. For example,

kind: PersistentVolumeClaim
apiVersion: v1
 name: name-of-my-pvc
 storageClassName: manual
   - ReadWriteOnce
     storage: 20Gi

In the above, one can change the name-of-my-pvc to any suitable name for your particular use case. Now, you should be able to list this resource by doing the following:

kubectl get pvc

I wish that the above helps and all the best.

Think different and code well,