Multi-node PVC access considerations¶
Multi-node PVC access considerations refers to the architectural constraints and configuration requirements for sharing data across different nodes within a Kubernetes cluster using [[PersistentVolumeClaim|PersistentVolumeClaims]] (PVCs).^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md]
In multi-node production environments, such as [[GKE|Google GKE]] or [[EKS|AWS EKS]], pods are not guaranteed to be scheduled on the same node.^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md] Consequently, storage solutions effective in single-node environments (like hostPath or ReadWriteOnce on local disk) may fail to provide shared access to resources required by distributed applications.
Access Modes¶
The ability for pods on different nodes to access the same PersistentVolume (PV) is dictated by the Access Modes defined in the PV and PVC specifications.^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md]
- ReadWriteOnce (RWO): The volume can be mounted as read-write by a single node. This mode permits multiple pods on the same node to access the volume, but it generally does not support simultaneous access from pods on different nodes^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
- ReadOnlyMany (ROX): The volume can be mounted as read-only by many nodes^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
- ReadWriteMany (RWX): The volume can be mounted as read-write by many nodes^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
To ensure that different pods and services across a cluster can successfully obtain shared resources, the PVC must specify ReadOnlyMany or ReadWriteMany access modes^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
Storage Classes and Provisioners¶
Simply declaring a ReadWriteMany access mode is insufficient if the underlying storage system does not support multi-writer or multi-node connectivity^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
- Limited Support: There are relatively few provisioners that support
ReadOnlyManyandReadWriteMany^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md]. - NFS Implementation: Multi-node shared access is typically implemented using network-based file systems, most commonly cloud-based NFS (Network File System) services^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
For example, in cloud environments like Google Cloud, distinct storage services are used to achieve specific access modes:
* Cloud FileStore (NFS): Used to implement ReadWriteMany for shared persistent data^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
* Compute Engine Disk (Block Storage): Typically implements ReadWriteOnce, which restricts the volume to a single node^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md].
Related Concepts¶
- [[PersistentVolumeClaim|PersistentVolumeClaim (PVC)]]
- StorageClass
- [[StatefulSet]]
- [[NodeSelector]]
Sources¶
^[400-devops__06-Kubernetes__k8s-ithelp__Day20__README.md]