Kubernetes: Can I mount different subPaths from the same PV onto different locations of the same container?
Looks like you are trying to attache the same PVC
into a different node
.
Access Modes Claims use the same conventions as volumes when requesting storage with specific access modes
In your .yaml
I can see, you have setup accessModes: ReadWriteOnce
.
A
PersistentVolume
can be mounted on a host in any way supported by the resource provider. As shown in the table below, providers will have different capabilities and each PV’s access modes are set to the specific modes supported by that particular volume. For example, NFS can support multiple read/write clients, but a specific NFS PV might be exported on the server as read-only. Each PV gets its own set of access modes describing that specific PV’s capabilities.The access modes are:
ReadWriteOnce – the volume can be mounted as read-write by a single node
ReadOnlyMany – the volume can be mounted read-only by many nodes
ReadWriteMany – the volume can be mounted as read-write by many nodes
From Kubernetes docs regarding Persistent Volumes
you can read that CephFS does support all accessModes