I have being using an external volume for the ElasticSearch pod’s storage and I have a question about it:
PVC configuration. On the volume’s options I can see that there is an option to manually mount it and also there is a guide about how to do it, but I think this is more related with the addition of new space. Is there a more simple way to do it?I hope anybody can help me to understand better and how is the best way to do it and also if somebody can guide me to make snapshots into certain volumes. I would really appreciate it.
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!
Hi there,
What I usually do with the DigitalOcean Managed Kubernetes Clusters is to use a PVC as described here in order to attach block storage to my clusters:
https://docs.digitalocean.com/products/kubernetes/how-to/add-volumes/
Here is an example configuration:
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-csi-app-set
spec:
selector:
matchLabels:
app: mypod
serviceName: "my-frontend"
replicas: 1
template:
metadata:
labels:
app: mypod
spec:
containers:
- name: my-frontend
image: busybox
args:
- sleep
- infinity
volumeMounts:
- mountPath: "/data"
name: csi-pvc
volumeClaimTemplates:
- metadata:
name: csi-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: do-block-storage
After that rather than resizing the block storage itself directly, to resize the volume, you can change the storage value directly via the PVC definition.
Or you could use kubectl edit pvc <pvc-name> and then increase the requested volume size.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.