Where I can find Kubernetes PV on the host filesystem?

4/23/2019

I am trying to understand how Kubernetes handles the persistent volumes on the node's filesystem.

For example, if I have a minikube as my Kubernetes cluster node, and I create multiple PVs with PVC for may pods and if I ssh to minikube, where I can find the PV on minikube's filesystem?

If I type

lsblk

I get

sda 8:0 0 19.5G 0 disk

but no PV disks are listed.

Thank you for your answers.

-- branko terzic
kubernetes
minikube

2 Answers

4/23/2019

You will not see it because it's inside API as an API Object.

I recommend reading Kubernetes documentation regarding Persistent Volumes.

A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.

A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes (e.g., can be mounted once read/write or many times read-only).

While PersistentVolumeClaims allow a user to consume abstract storage resources, it is common that users need PersistentVolumes with varying properties, such as performance, for different problems. Cluster administrators need to be able to offer a variety of PersistentVolumes that differ in more ways than just size and access modes, without exposing users to the details of how those volumes are implemented. For these needs there is the StorageClass resource.

Please see the detailed walkthrough with working examples.

You can also have a look at the Kubernetes Volumes Guide which explains the types of storage, how long do they last and how to use them in examples.

-- Crou
Source: StackOverflow

4/23/2019

Because they are hostPath, you will not see them in lsblk. Use "kubectl describe pv PV_NAME" to understand where they are located.

-- Vasily Angapov
Source: StackOverflow