Questions tagged [persistent-volume-claims]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
148 votes
12 answers
308k views

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. ...
Mikhail Janowski's user avatar
146 votes
11 answers
73k views

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's user avatar
  • 2,225
115 votes
13 answers
120k views

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-...
Yannic Bürgmann's user avatar
76 votes
5 answers
88k views

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 ...
ilegolas's user avatar
  • 895
75 votes
13 answers
147k views

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: ...
Akash Krishnan's user avatar
50 votes
5 answers
45k views

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 ...
John's user avatar
  • 11.4k
37 votes
2 answers
115k views

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: ...
overflowed's user avatar
  • 1,155
35 votes
3 answers
42k views

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 ...
theoneandonly2's user avatar
25 votes
4 answers
59k views

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 ...
Makin's user avatar
  • 281
24 votes
1 answer
14k views

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 ...
Abhishek Jaisingh's user avatar
21 votes
4 answers
18k views

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. ...
Ondra Žižka's user avatar
19 votes
5 answers
51k views

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: ...
asdfaewefgav's user avatar
17 votes
1 answer
29k views

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 (...
Gong Yi's user avatar
  • 199
16 votes
1 answer
26k views

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 ...
Rutnet's user avatar
  • 1,603
14 votes
2 answers
27k views

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 ...
Aniket's user avatar
  • 165
12 votes
3 answers
22k views

How do I change the storage class of existing persistent volumes?

I have a bunch of standard PVs bound to PVCs in Kubernetes running in Google Kubernetes Engine. I want to change their storage class to SSD. How do I achieve that?
Souvik Dey's user avatar
10 votes
1 answer
7k views

Shared directory for a kubernetes Deployment between it's replicas

I have a simple deployment with 2 replicas. I would like that each of the replicas have same storage folder in them (shared application upload folder) I've been playing with claims and volumes, but ...
mkasepuu's user avatar
  • 243
10 votes
4 answers
10k views

Kubernetes - MountVolume.NewMounter initialization failed for volume "<volume-name>" : path does not exist

I am trying to setup a Local Persistent volume using local storage using WSL. But the pod STATUS stops at Pending. The kubectl describe pod <pod-name> gives below error. Warning FailedMount ...
Kodi's user avatar
  • 113
9 votes
1 answer
13k views

Add persistent volume in Kubernetes StatefulSet on Minikube

I'm new to Kubernetes and I'm trying to add a PVC in my StatefulSet on Minikube. PV and PVC are shown here: NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM ...
dimzak's user avatar
  • 2,551
9 votes
2 answers
12k views

Kubernetes Permission denied for mounted nfs volume

The following is the k8s definition used: apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nfs-pv-provisioning-demo labels: demo: nfs-pv-provisioning spec: accessModes: [ "...
lokanadham100's user avatar
9 votes
1 answer
13k views

How to reuse an existing persistent volume claims

I have deleted my elasticsearch cluster, but now after I've deployed a new cluster I need to access the old data that was stored on 3 Persistent Volumes PV described bellow: NAME ...
PhiloJunkie's user avatar
  • 1,139
8 votes
2 answers
9k views

Can we get Persistent Volume with only PVC (without PV) in k8s?

I just saw a yaml file for Postgres with PersistentVolumeClaim and volumeMounts and volumes with the persistentVolumeClaim in the postgres container. I couldn't find any PersistentVolume defined. ...
injoy's user avatar
  • 4,273
8 votes
3 answers
11k views

delete Kubernetes persistent volume from statefulset after scale down

I scaled my statefulset up to 4, and when scaling down to 1, I saw that I still have 4 persistent volumes with indexes from 0 to 3. I also saw that the status of all of them is Bound I guess it is ...
toto's user avatar
  • 1,347
8 votes
3 answers
6k views

Is it possible to have the same PVC as two volumes in Kubernetes?

My pod declares two different volumes. I use some definition templating, and depending on the environment in some cases I would like to reuse the same claim for the two volumes. This results in an ...
egt's user avatar
  • 175
8 votes
1 answer
10k views

Persistent volume claim not claiming the volume

I have this persistent volume claim $ kubectl get pvc -ngitlab-managed-apps NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE prometheus-prometheus-server ...
CyberProdigy's user avatar
8 votes
1 answer
15k views

Resizing PVC in Kubernetes With Kubectl edit

Recently I tried to resize PersistentVolumeClaim with help of Kubectl edit pvc to increase storage from 10 Gi to 70 Gi but it’s giving error: persistentvolumeclaims "myclaim" was not valid: *...
Aftab's user avatar
  • 91
7 votes
4 answers
13k views

Cannot deploy MySQL pod. --initialize specified but the data directory has files in it

I'm trying to setup a MySQL pod on Digital Ocean with Kubernetes. I kept getting this error: Initializing database 2019-03-05T14:32:58.707421Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is ...
a.barbieri's user avatar
  • 2,516
7 votes
2 answers
5k views

Kubernetes ReadWriteOnce Multi-Attach deadlock on deployment reload/restart

Consider the below PersistentVolumeClaim, as well as the Deployment using it. Being ReadWriteOnce, the PVC can only be mounted by one node at the time. As there shall only be one replica of my ...
John-Arne Boge's user avatar
7 votes
1 answer
4k views

Create PersistentVolumeClaim imperative way?

Why can't we create PV or PVC in imperative way? Trying using create command, but it doesn't show any of them. kubectl create --help Available Commands: clusterrole Create a ClusterRole. ...
Nurhun's user avatar
  • 562
7 votes
1 answer
15k views

Kubernetes Multi-Attach error for volume "pvc "Volume is already exclusively attached to one node and can't be attached to another"

Kubernetes version: V1.22.2 Cloud Provider Vsphere version 6.7 Architecture: 3 Masters 15 Workers What happened: One of the pods for some "unknown" reason went down, and when we try to ...
Ruben Gonçalves's user avatar
6 votes
2 answers
6k views

how to bound a Persistent volume claim with a gcePersistentDisk?

I would like to bound PersistentVolumeClaim with a gcePersistentDisk PersistentVolume. Below the steps I did for getting that: 1. Creation of the gcePersistentDisk: gcloud compute disks create --...
Amine Jallouli's user avatar
6 votes
1 answer
13k views

k8s Deployment set readOnly in volumes vs volumeMounts

I want to utilize data from a persistent volume as readOnly inside a container. What is the difference of setting the readOnly flag under the volumeMounts vs the deployment volumes....
Gr3at's user avatar
  • 400
5 votes
3 answers
6k views

Kubernetes Delete Persistent Voulmes Created by hostPath

I created a PV and a PVC on docker-desktop and even after removing the pv and pvc the file still remains. When I re-create it, it attaches the same mysql database to new pods. How do you manually ...
joshduffney's user avatar
5 votes
1 answer
5k views

Create Persistent volume using command line (without using any file)

I want to create PV using the kubectl command line, Is it possible in Kubernetes or not. If it is possible then how?
user15003460's user avatar
5 votes
1 answer
8k views

Multiple pods using same database on kubernetes

I would like to know if it is possible for multiple pods in the same Kubernetes cluster to access a database which is configured using persistent volumes on a Google cloud persistent disk. Currently ...
suprith's user avatar
  • 93
5 votes
2 answers
7k views

Kubernetes: NFS with StatefulSets

I'm trying to use existing NFS with StateFulSets. Creation of PresistentVolumeClaim seems automatic using the volumeClaimTemplates. Problem: But, since the PresistentVolumeClaim claims a entire ...
Shan's user avatar
  • 2,161
4 votes
2 answers
8k views

Re-use PersistentVolume after re-installing a helm deployment

When I helm delete <deploymentname> a deployment its PVs and PVCs are deleted as well. How can I avoid the actual data in the PVs from being deleted and be able to reclaim those PVs when I helm ...
Hedge's user avatar
  • 16.5k
4 votes
3 answers
16k views

Mounting kubernetes volume with User permission

I am using Kubernetes yaml to mount a volume. I know I can set the mount folder to be for a specific group using this configuration: securityContext: fsGroup: 999 but no where I can find a way ...
toto's user avatar
  • 1,347
4 votes
2 answers
7k views

Is it possible to have PVC's with the same name accross different namespace when using different PV's in Kubernetes?

I have 2 different namespace: prod-01 and prod-02, What I want to do is build a copy of my prod-01 into prod-02 namespace keeping the same names for its pvcs, so that I don't have to maintain 2 sets ...
silveiralexf's user avatar
4 votes
3 answers
6k views

Kubernetes - Mounting Persistent Volume as root directory

I'm trying to create a new Kubernetes deployment that will allow me to persist a pod's state when it is restarted or shutdown. Just for some background, the Kubernetes instance is a managed Amazon EKS ...
ChrisDevWard's user avatar
4 votes
2 answers
7k views

HostPath assign persistentVolume to the specific work node in cluster

Using kubeadm to create a cluster, I have a master and work node. Now I want to share a persistentVolume in the work node, which will be bound with Postgres pod. Expecting the code will create ...
ccd's user avatar
  • 6,462
4 votes
1 answer
1k views

Creating a PersistentVolume on Okteto Cloud

When I try to create a persistentVolume on Okteto Cloud with the following definition: kind: PersistentVolume apiVersion: v1 metadata: name: postgres-pv labels: type: local app: postgres ...
Nicolas Marshall's user avatar
4 votes
2 answers
2k views

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 ...
Jsh0s's user avatar
  • 569
4 votes
2 answers
4k views

Kubernetes AKS Persistent Volume Disk Claims To Multiple Nodes

How can I attach 100GB Persistent Volume Disk to Each Node in the AKS Kubernetes Cluster? We are using Kubernetes on Azure using AKS. We have a scenario where we need to attach Persistent Volumes ...
Chris Langston's user avatar
4 votes
1 answer
5k views

Kubernetes not claiming persistent volume - "failed due to PersistentVolumeClaim is not bound: "task-pv-claim", which is unexpected."

I'm not sure why the persistent volume is not being claimed, or what steps I could take to further diagnose this? Should the claim size match the volume size? Should the volume size match the GCP ...
Chris Stryczynski's user avatar
4 votes
1 answer
3k views

How to recover pv(Released) data after pvc deletion

I have a kubernetes cluster on the eks of aws. I use aws-ebs as the Provisioner of StorageClass, and the ReclaimPolicy is set to Retain. I install the application with helm. When I delete the ...
gophergfer's user avatar
4 votes
2 answers
2k views

Are Pods forced to run on nodes where their persistent volumes exist?

I'm teaching myself Kubernetes with a 5 Rpi cluster, and I'm a bit confused by the way Kubernetes treats Persistent Volumes with respect to Pod Scheduling. I have 4 worker nodes using ext4 formatted ...
Nick Saccente's user avatar
4 votes
1 answer
5k views

How to create an kubernetes NFS volume on Google Container Engine

I am trying to create a kubernetes NFS volume on Google Container Engine (GKE) and get it used by a deployment. I did this in several steps as it shown in this github repository kubernetes-nfs-volume-...
Amine Jallouli's user avatar
4 votes
2 answers
2k views

Can I use existing GCE persistent disk in volumeClaimTemplate of Kubernetes Statefulset

I am using Google Container Engine to run a StatefulSet for MongoDB replica set (3 replica pods). This works fine with dynamic provisioning of persistent storage - that is new storage is provisioned ...
conundrum's user avatar
3 votes
2 answers
3k views

PersistentVolume and PersistentVolumeClaim for multiple deployments

I have 3 deployments, a-depl, b-depl, c-depl. Now each of these 3 deployments has a db deployment: a-db-depl, b-db-depl, c-db-depl. Now I want to persist each of these dbs. Do I need to create a ...
potatoxchip's user avatar

1
2 3 4 5 6