There are several ways to configure data storage for applications running in a Kubernetes cluster. Some of them are already outdated, others have appeared quite recently. In this article, we will consider the concept of three storage connection options, including the most recent one - connection via the Container Storage Interface.
1. PV
, Kubernetes:
, , .
volumeMounts (mountPath) — , .
volumes , . , ( : awsElasticBlockStore) . , .
. .
, Kubernetes , .
:
- , Kubernetes ;
- , , ;
- (, AWS Google Cloud), .
, : configMap, secret, emptyDir, hostPath:
configMap secret — , Kubernetes.
emptyDir — , . . pod , emptyDir .
hostPath — , , — /etc/kubernetes. , . /etc/kubernetes . , hostPath , namespace kube-system.
2. SC/PVC/PV
— Storage class, PersistentVolumeClaim, PersistentVolume.
Storage class .
PersistentVolumeClaim , .
PersistentVolume .
: volume PersistentVolumeClaim claimName.
PersistentVolumeClaim , . :
- ;
- : ReadWriteOnce ReadWriteMany;
- Storage class — .
Storage class . , .
PersistentVolume Storage class (ID , , . .).
PVC, Kubernetes , Storage class , PersistentVolume.
PV , Kubernetes — Provisioner ( Storage class). , , Kubernetes PersistentVolume, PersistentVolumeClaim.
, , .
Storage class, . , AWS Google Cloud, — Storage class PVC. Persistance Volume , Provisioner.
3. Container Storage Interface
, , Kubernetes. , Kubernetes. .
, Cloud Foundry, Kubernetes, Mesos Docker Container Storage Interface (CSI) — , (CSI Driver), . Kubernetes .
, CSI Driver : Node Plugin Controller plugin.
Node Plugin . Controller plugin : , . .
Kubernetes , CSI Driver , .
, Storage class, . — Storage class, . helm chart . Storage class , helm chart, Storage class. , .
, , , Ceph CSI .
Ceph CSI , .
- . RBD RWO, CSI Ceph RWX. pod' RDB- . , — , .
- . Kubernetes . CSI . , PersistentVolume.
- PersistentVolume Kubernetes.
- . Kubernetes CephFS , CSI- Ceph Nautilus CephFS-.
- . CSI- Prometheus , , . .
- Topology aware. , , , , .
Ceph Kubernetes CSI, . - Ceph, 15 .
: , Southbridge, Certified Kubernetes Administrator, kubespray.