Kubernetes - Persistent Volumes đ°
Description đ
Persistent Volumes are a way to store data in a pod that will persist even if the pod is destroyed. Persistent Volumes are also a way to share data between pods. Persistent Volumes are a resource that is independent of the pod lifecycle. This means that Persistent Volumes can be created, used, and destroyed independently of the pod lifecycle.
Examples đ§Š
-
persistent volumedefinitionapiVersion: v1 kind: PersistentVolume metadata: name: pv-vol1 spec: # access mode defines how the volume should be mounted on the host accessModes: - ReadWriteOnce capacity: storage: 1Gi # host path is the path on the host where the volume will be mounted, there are other types of volumes hostPath: path: /tmp/dat -
pvto be added on in pvc sectionapiVersion: v1 kind: PersistentVolume metadata: name: pv-log spec: accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain capacity: storage: 100Mi hostPath: path: /pv/log- supported access modes are
- ReadOnlyMany
- ReadWriteMany
- ReadWriteOnce
- supported access modes are