# https://raw.githubusercontent.com/kubernetes/website/main/content/zh/examples/pods/storage/pv-volume.yaml
# https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-persistent-volume-storage/
apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 4Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/data"


# sudo mkdir /mnt/data
# sudo sh -c "echo 'Hello from Kubernetes storage' > /mnt/data/index.html"
# kubectl apply -f https://k8s.io/examples/pods/storage/pv-volume.yaml
# kubectl get pv task-pv-volume
# (venv) ➜  k8s git:(dev) kubectl get pv -o wide
# NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE   VOLUMEMODE
# task-pv-volume   1Gi        RWO            Retain           Available           manual                  20s   Filesystem
# (venv) ➜  k8s git:(dev)