I'm trying to figure out how I can use a single nfs share with k8s persistent volume claims.
For example, let's say I have a single nfs pv configured:
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: nfs-storage
nfs:
path: /var/nfs_exports
server: 10.9.0.205
readOnly: false
Is it possible to create multiple volume claims that map to subdirectories within this single share?
For example again, let's say I create the following volume claims:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: influx-data
namespace: kube-system
spec:
storageClassName: nfs-storage
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
---
and:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-data
namespace: kube-system
spec:
storageClassName: nfs-storage
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
---
I guess, that both claims will be bound to the pv, but there is no way to seperate the data of both elasticsearch and influxdb.
I hope you understand what I'm trying to do here (sorry, I find it difficult to explain). I just want to use a single nfs share that can be used by multiple pods, while still keeping their data seperate.