Ada beberapa cara untuk mengonfigurasi penyimpanan data untuk aplikasi yang berjalan di cluster Kubernetes. Beberapa di antaranya sudah usang, yang lain baru saja muncul. Pada artikel ini, kami akan mempertimbangkan konsep tiga opsi koneksi penyimpanan, termasuk yang terbaru - koneksi melalui Container Storage Interface.

Metode 1. Menentukan PV dalam Manifes Pod
Manifes khas yang mendeskripsikan pod di cluster Kubernetes:

Bagian manifes yang mendeskripsikan volume mana yang terhubung dan di mana disorot dalam warna.
Di bagian volumeMounts, tunjukkan titik pemasangan (mountPath) - di direktori mana di dalam penampung volume persisten akan dipasang, serta nama volume.
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.
