apiVersion: v1
kind: ReplicationController
metadata:
  name: patroni-controller
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: patroni
    spec:
      containers:
      - name: patroni
        image: quay.io/ukhomeofficedigital/postgres-patroni:v0.2.2-rc5
        args:
          - --etcd=192.168.1.11
        env:
          - name: ADMINUSER
            value: "postgres"
          - name: ADMINPASS
            value: "dbadmin"
          - name: CLUSTER
            value: "pg"
          - name: SYNCHRONOUS
            value: "on"
        ports:
          - containerPort: 5000
          - containerPort: 5001
          - containerPort: 8001
        livenessProbe:
          tcpSocket:
            port: 5432
          initialDelaySeconds: 15
          timeoutSeconds: 1
        volumeMounts:
          - mountPath: /srv/data
            name: data
      volumes:
        - hostPath:
            path: /data/pg
          name: data
