apiVersion: v1
kind: PersistentVolume
metadata:
  name: prometheus-local-pv
  labels:
    type: local
    name: prometheus
spec:
  capacity:
    storage: 100Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Delete
  storageClassName: local-storage
  local:
    path: /mnt/k8s/prometheus
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
                - server-3

#---

# kind: StorageClass
# apiVersion: storage.k8s.io/v1
# metadata:
#   name: local-storage
# provisioner: kubernetes.io/no-provisioner
# volumeBindingMode: WaitForFirstConsumer

---

# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
#   namespace: default
#   name: prometheus-local-pvc
# spec:
#   volumeName: prometheus-local-pv
#   storageClassName: "local-storage"
#   accessModes:
#     - ReadWriteOnce
#   resources:
#     requests:
#       storage: 100Gi
