apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: zookeeper
spec:
  selector:
    matchLabels:
      app: zookeeper
  serviceName: "zookeeper"
  replicas: 1
  template:
    metadata:
      labels:
        app: zookeeper
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: zookeeper
        image: zookeeper:3.6
        imagePullPolicy: Always
        ports:
        - containerPort: 2181
        volumeMounts:
        - name: zookeeper-data-persistent-storage
          mountPath: /data
        - name: zookeeper-datalog-persistent-storage
          mountPath: /datalog
        resources:
          limits:
            memory: "1Gi"
            cpu: "1"
          requests:
            memory: "32Mi"
            cpu: "100m"
      nodeSelector:
        intendedfor: kafka
  volumeClaimTemplates:
  - metadata:
      name: zookeeper-data-persistent-storage
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 5Gi
  - metadata:
      name: zookeeper-datalog-persistent-storage
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 5Gi
