Q:❓What is a Volume❓
A: A directory with data accessible to all containers in a pod.
Kubernetes supports many types of volumes.
🔸 Persistent Volumes
🔸 Ephemeral Volumes
🔸 Projected Volumes
A pod can use any number of volume types simultaneously.
This is a storage element in a cluster, defined manually by an administrator or dynamically defined by a storage class.
A PV has its own lifecycle, separate from the lifecycle of Kubernetes pods.
This one defines a storage request.
Let's say we have an application running on a container that needs a certain type of storage: 3 Gi of storage and needs to read and write data.
accessModes: - ReadWriteOnce
Let's put them all together!
The pod running the application doesn't need to know the exact PV it's accessing.
It only needs to specify what type of access it needs, how much storage, and what type of storage.
- name: pv-storage
- name: pv-container
- mountPath: "/usr/share/nginx/html"