apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    app: redis
    type: local
  name: redis-pv-master
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 8Gi
  claimRef:
    kind: PersistentVolumeClaim
    name: redis-data-redis-master-0
    namespace: imxc
  hostPath:
    path: {{ .Values.global.IMXC_REDIS_PV_PATH1 }}
  persistentVolumeReclaimPolicy: Retain
  storageClassName: manual
  volumeMode: Filesystem
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: {{ .Values.global.affinity_key }}
              operator: In
              values:
              - {{ .Values.global.affinity_value1 }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    app: redis
    type: local
  name: redis-pv-slave-0
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 8Gi
  claimRef:
    kind: PersistentVolumeClaim
    name: redis-data-redis-slave-0
    namespace: imxc
  hostPath:
    path: {{ .Values.global.IMXC_REDIS_PV_PATH2 }}
  persistentVolumeReclaimPolicy: Retain
  storageClassName: manual
  volumeMode: Filesystem
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: {{ .Values.global.affinity_key }}
              operator: In
              values:
              - {{ .Values.global.affinity_value2 }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  labels:
    app: redis
    type: local
  name: redis-pv-slave-1
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 8Gi
  claimRef:
    kind: PersistentVolumeClaim
    name: redis-data-redis-slave-1
    namespace: imxc
  hostPath:
    path: {{ .Values.global.IMXC_REDIS_PV_PATH3 }}
  persistentVolumeReclaimPolicy: Retain
  storageClassName: manual
  volumeMode: Filesystem
  nodeAffinity:
    required:
      nodeSelectorTerms:
        - matchExpressions:
            - key: {{ .Values.global.affinity_key }}
              operator: In
              values:
              - {{ .Values.global.affinity_value3 }}
