Questions tagged [persistent-volumes]

This tag is for Kubernetes persistent volume related questions.

Kubernetes Persistent Volumes is a subsystem for managing storage. The PV subsystem is responsible for how the storage is provided whereas the PersistentVolumeClaim is the abstraction that is related to how the storage is consumed by the application.

771 questions
3
votes
2 answers

Need of storageClassName in PV and PVC

I created PV as follows: apiVersion: v1 kind: PersistentVolume metadata: name: foo-pv spec: storageClassName: "my-storage" claimRef: name: foo-pvc namespace: foo Why we need to give storageClassName in PV? When Storage class creates…
Vasu Youth
  • 323
  • 3
  • 13
3
votes
1 answer

Error con Pods in Azure k8s (Volume capability not supported)

I created disk in azure k8s cluster (4Gb standard HDD) I am using code PV Pv file Then I am creating PVC: PVC yaml Attach my volume to Pod: Pod volume attache But when I checked the status of my Pod, I got an error: root@k8s:/home/azureuser/k8s#…
Oleg
  • 161
  • 1
  • 2
  • 10
3
votes
2 answers

How to fix docker error "readonly file system: unknown"?

I was treing to set the project on my local machine as readonly for the docker container, like this: docker run -d \ -p 3000:3000 \ -v $PWD:/app:ro \ -v /app/node_modules \ --name $1 \ $(docker images | awk '{print $1}' | awk…
code_dude
  • 951
  • 2
  • 15
  • 28
3
votes
0 answers

Kubernetes - Nginx cached content is getting deleted when stored in AWS EFS volume

I am using the official Nginx image with modified config to cache origin responses. The configuration below is includeed in the http block inside the /etc/nginx/nginx.conf (The main config file for Nginx) proxy_cache_path /var/nginx-cache …
3
votes
0 answers

Migrate Kubernetes storage from vSphere to NFS with StatefulSets

I'm trying to move all my persistent volumes from vSphere to NFS, I managed to do it for many applications that use Deployment kind. All I have to do is: Mount the NFS volume to a different path (/tmp for example) Copy the data from vSphere volume…
3
votes
0 answers

Kubernetes PersistentVolume data is lost after physical machine restart

I recently started using PersistentVolumes and PersistenVolumeClaims for persistent storage in my container. My end goal is to make sure that a file in a specific folder (let's call it data) on the container survives any restart. The implementation…
Axel
  • 311
  • 2
  • 9
3
votes
3 answers

Unable to attach or mount volumes : timed out waiting for the condition

While mounting my EBS volume to the kubernetes cluster I was getting this error : Warning FailedMount 64s kubelet Unable to attach or mount volumes: unmounted volumes=[ebs-volume], unattached volumes=[ebs-volume…
3
votes
1 answer

How to save data in Kubernetes? I have tried Persistent Volume but it doesn't solve the problem

There is a folder name "data-persistent" in the running container that the code reads and writes from, I want to save the changes made in that folder. when I use persistent volume, it removes/hides the data from that folder and the code gives an…
3
votes
1 answer

multiple persistent volume claims on the same persistent volume

I am working with kubernetes for a long time and I have a question that I am not sure what the answer is. If I create a PersistentVolume and couple of PersistentVolumeClaims that uses that PersistentVolume. I mapped different PersistentVolumeClaims…
DaniDin
  • 91
  • 9
3
votes
1 answer

Kubernetes StorageClassName: quantities must match the regular expression

I have the following pv.yaml Kubernetes/Kustomization file: apiVersion: v1 kind: PersistentVolume metadata: name: myapp-common-pv namespace: myapp labels: app.kubernetes.io/name: myapp-common-pv app.kubernetes.io/component: common-pv …
3
votes
2 answers

Does the Storage class need to be created in Kubernetes before referring them in PV/PVC?

I have a PV alpha-pv in the kubernetes cluster and have created a PVC matching the PV specs. The PV uses the Storage Class: slow. However, when I check the existence of Storage Class in Cluster there is no Storage Class existing and still my PVC was…
3
votes
1 answer

Kubernetes, how to share read/write persistent volume as read only volume with other nodes

I have a persistent volume that has read/write access on one specific node. How can I mount this persistent volume on all other nodes as read only? Here is what I was thinking, in my pvc.yaml: --- apiVersion: v1 kind:…
Ouss
  • 2,912
  • 2
  • 25
  • 45
3
votes
1 answer

How to create a dynamic persistent volume claim with ReadWriteMany access in GKE?

Currently GCEPersistentDisk does not support ReadWriteMany natively, there are other options like filestore which creates a NFS volume, but there are 2 problem here: minimum 1 TB size is needed to be created secondly its a manually effort of…
3
votes
2 answers

In which real world scenario would you use ReadWriteOnce over ReadWriteMany for a PVC in Kubernetes?

Just as a quick reminder, said option limits how many nodes can read / write to a volume, not how many pods can access it. You can have a RWO volume accesed by multiple pods as long as they are running in the same worker node. Having said that, when…
Jsh0s
  • 519
  • 1
  • 8
  • 18
3
votes
2 answers

Reattach a Dynamically Provisioned PV to a PVC

I deployed a PVC, which dynamically created a PV. After that I deleted the PVC and now my PV looks like below: PS Kubernetes> kubectl get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM …