Applications use disks for various reasons:
Application state must be separated from the process
Kubernetes "doesn't know" about disk space
https://docs.microsoft.com/en-us/azure/aks/concepts-storage
Kuberntes "wraps" the storage in its object.
Access to the folder is:
https://kubernetes.io/docs/concepts/storage/persistent-volumes/#raw-block-volume-support,
Static provisioning
PersistentVolume
is created by the administrator (kubectl apply
).Dynamic provisioning
PersistentVolumeClaim
object.Affinity: The volume will be bound to a specific node.
We need:
We create the object that belongs to the application together with Deployment
or StatefulSet
PersistentVolume
Access to a local or distributed file system
+------------+ Binding +--------------+
| Persistent |<--------| Persistent |
| Volume | | Volume Claim |
+------------+ +--------------+
Hardware Container
(similar to Deployment
)
We declare `PODs' that the application needs
We declare the claims of the application on volumes
StatefulSet
depends on PersistentVolume
.
POD
using ReplicaSet
PersistentVolume
using PersistentVolumeClaim
Storage
+------------------+
| PersistentVolume | LoadBalancer
+------------------+
^ P.V. Claim ^
| |
+--------------+ Port +-----------+
| POD Template |------>| Service |
| ReplicaSet | +-----------+
| StatefulSet |
+--------------+
node
The worst task is to "free" a 2 TB disk full of various data