Questions tagged [persistent-volume-claims]
284 questions
143
votes
11 answers
What is the difference between persistent volume (PV) and persistent volume claim (PVC) in simple terms?
What is the difference between persistent volume (PV) and persistent volume claim (PVC) in Kubernetes/ Openshift by referring to documentation?
What is the difference between both in simple terms?

smc
- 2,175
- 3
- 17
- 30
132
votes
12 answers
Kubernetes: how to set VolumeMount user group and file permissions
I'm running a Kubernetes cluster on AWS using kops. I've mounted an EBS volume onto a container and it is visible from my application but it's read only because my application does not run as root. How can I mount a PersistentVolumeClaim as a user…

Mikhail Janowski
- 4,209
- 7
- 28
- 40
112
votes
12 answers
Kubernetes: Can't delete PersistentVolumeClaim (pvc)
I created the following persistent volume by calling
kubectl create -f nameOfTheFileContainingTheFollowingContent.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-monitoring-static-content
spec:
capacity:
storage: 100Mi
…

Yannic Bürgmann
- 6,301
- 5
- 43
- 77
70
votes
12 answers
Kubernetes Persistent Volume Claim Indefinitely in Pending State
I created a PersistentVolume sourced from a Google Compute Engine persistent disk that I already formatted and provision with data. Kubernetes says the PersistentVolume is available.
kind: PersistentVolume
apiVersion: v1
metadata:
name:…

Akash Krishnan
- 1,819
- 1
- 14
- 16
67
votes
5 answers
How to identify the storage space left in a persistent volume claim?
I have a Kubernetes cluster on Google Cloud Platform. It has a persistent Volume Claim with a Capacity of 1GB. The persistent volume claim is bound to many deployments.
I would like to identify the space left in the persistent Volume Claim in order…

ilegolas
- 805
- 1
- 7
- 10
47
votes
5 answers
Kubernetes NFS Persistent Volumes - multiple claims on same volume? Claim stuck in pending?
Use case:
I have a NFS directory available and I want to use it to persist data for multiple deployments & pods.
I have created a PersistentVolume:
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
spec:
capacity:
storage: 10Gi
…

John
- 10,837
- 17
- 78
- 141
36
votes
2 answers
Kubernetes - pod has unbound immediate PersistentVolumeClaims
I'm using mysql Kubernetes statefulset, i mapped PVs to host directory (CentOS 8 VM) but getting " pod has unbound immediate PersistentVolumeClaims"
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql-container
spec:
serviceName: mysql
…

overflowed
- 1,095
- 1
- 18
- 39
31
votes
3 answers
Kubernetes: Is it possible to mount volumes to a container running as a CronJob?
I'm attempting to create a Kubernetes CronJob to run an application every minute.
A prerequisite is that I need to get my application code onto the container that runs within the CronJob. I figure that the best way to do so is to use a persistent…

theoneandonly2
- 721
- 1
- 9
- 21
23
votes
4 answers
MountVolume.SetUp failed for volume "nfs" : mount failed: exit status 32
This is 2nd question following 1st question at
PersistentVolumeClaim is not bound: "nfs-pv-provisioning-demo"
I am setting up a kubernetes lab using one node only and learning to setup kubernetes nfs. I am following kubernetes nfs example step by…

Makin
- 261
- 2
- 3
- 4
22
votes
1 answer
Bind different Persistent Volume for each replica in a Kubernetes Deployment
I am using a PVC with ReadWriteOnce access mode, which is used by a logstash Deployment which will run a stateful application and use this PVC.Each pod in the deployment will try to bind to the same persistent volume claim. In case of replicas > 1,…

Abhishek Jaisingh
- 1,614
- 1
- 13
- 23
18
votes
4 answers
Kubernetes: how to do dynamic PersistentVolumeClaim with persistentVolumeReclaimPolicy: Reclaim
I have a dynamic PersistentVolume provisioned using PersistentVolumeClaim.
I would like to keep the PV after the pod is done. So I would like to have what persistentVolumeReclaimPolicy: Retain does.
However, that is applicable to PersistentVolume,…

Ondra Žižka
- 43,948
- 41
- 217
- 277
17
votes
5 answers
How can I mount the same persistent volume on multiple pods?
I have a three node GCE cluster and a single-pod GKE deployment with three replicas. I created the PV and PVC like so:
# Create a persistent volume for web content
apiVersion: v1
kind: PersistentVolume
metadata:
name: nginx-content
labels:
…

asdfaewefgav
- 171
- 1
- 1
- 3
16
votes
1 answer
Can I rely on volumeClaimTemplates naming convention?
I want to setup a pre-defined PostgreSQL cluster in a bare meta kubernetes 1.7 with local PV enable. I have three work nodes. I create local PV on each node and deploy the stateful set successfully (with some complex script to setup Postgres…

Gong Yi
- 189
- 1
- 1
- 5
14
votes
1 answer
State of PV/PVC after Pod is Deleted in Kubernetes
I have a Kubernetes cluster with some pods deployed (DB, Frontend, Redis). A part that I can't fully grasp is what happens to the PVC after the pod is deleted.
For example, if I delete POD_A which is bound to CLAIM_A I know that CLAIM_A is not…

Rutnet
- 1,533
- 5
- 26
- 48
13
votes
2 answers
Can we connect multiple pods to the same PVC?
I mean is there a one to one or many to one relationship between pod and PVC? Can I connect two or more pods to the same PVC(persistent volume claims) without deleting or disconnecting the earlier created pods?

Aniket
- 153
- 1
- 2
- 8