# https://kubernetes.io/docs/concepts/storage/persistent-volumes/

# A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or
# dynamically provisioned using Storage Classes. It is a resource in the cluster just like a node is a cluster resource.
# PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV.

# A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a Pod. Pods consume node resources
# and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request
# specific size and access modes (e.g., they can be mounted ReadWriteOnce, ReadOnlyMany or ReadWriteMany).

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: sip-postgres-pvc
  namespace: default
spec:
  storageClassName: sip-storageclass # Must match with StorageClass.
  accessModes:
    - ReadWriteOnce # Define the volume can be mounted as read-write by a single node.
  volumeMode: Filesystem # Define the volume as a filesystem.
  resources:
    requests:
      storage: 1Gi
    limits:
      storage: 5Gi
