apiVersion: v1
kind: PersistentVolume
metadata:
  name: zookeeper-cluster-1
  labels:
    type: local
    app: zookeeper
spec:
  capacity:
    storage: 30Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: {{ .Values.global.IMXC_ZOOKEEPER_PATH1 }}
  persistentVolumeReclaimPolicy: Retain
  storageClassName: zookeeper-storage
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: {{ .Values.global.affinity_key }}
          operator: In
          values:
          - {{ .Values.global.affinity_value1 }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: zookeeper-cluster-2
  labels:
    type: local
    app: zookeeper
spec:
  capacity:
    storage: 30Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: {{ .Values.global.IMXC_ZOOKEEPER_PATH2 }}
  persistentVolumeReclaimPolicy: Retain
  storageClassName: zookeeper-storage
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: {{ .Values.global.affinity_key }}
          operator: In
          values:
          - {{ .Values.global.affinity_value2 }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: zookeeper-cluster-3
  labels:
    type: local
    app: zookeeper
spec:
  capacity:
    storage: 30Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: {{ .Values.global.IMXC_ZOOKEEPER_PATH3 }}
  persistentVolumeReclaimPolicy: Retain
  storageClassName: zookeeper-storage
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: {{ .Values.global.affinity_key }}
          operator: In
          values:
          - {{ .Values.global.affinity_value3 }}
