---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: $NAME
  labels:
    volume.group: $GROUP
    volume.id: "$VOLUME_ID"
spec:
  capacity:
    storage: $VOLUME_SIZE
  accessModes:
  - ReadWriteMany
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: $VOLUME_ROOT
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - $NODENAME
