apiVersion: v1
kind: PersistentVolume
metadata:
  name: postgres-pv-{{namespace}}
  labels: 
    volume-for: postgres
spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteMany
  volumeMode: Filesystem
  persistentVolumeReclaimPolicy: Retain
  local:
    path: "/home/postgres_data"
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - "{{hostname}}"