Report this

What is the reason for this report?

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

Posted on August 28, 2020

Hello,

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?



This textbox defaults to using Markdown to format your 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
metadata:
 name: name-of-my-pvc
spec:
 storageClassName: manual
 selector:
 accessModes:
   - ReadWriteOnce
 resources:
   requests:
     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,

-Conrad

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.