apiVersion: v1
kind: ReplicationController
metadata:
  name: zookeeper-controller-3
  namespace: default
  labels:
    group: zookeeper-controller
    app: zookeeper-controller-3
spec:
  replicas: 1
  selector:
    app: zookeeper-pod-3
  template:
    metadata:
      labels:
        group: zookeeper-pod
        app: zookeeper-pod-3
    spec:
      containers:
      - name: zookeeper-container-3
        image: mosuka/docker-zookeeper:release-3.4
        ports:
        - name: client
          containerPort: 2181
          protocol: TCP
        - name: peer
          containerPort: 2888
          protocol: TCP
        - name: election
          containerPort: 3888
          protocol: TCP
        env:
        - name: ZOOKEEPER_ID
          value: "3"
        - name: ZOOKEEPER_SERVER_1
          value: zookeeper-service-1
        - name: ZOOKEEPER_SERVER_2
          value: zookeeper-service-2
        - name: ZOOKEEPER_SERVER_3
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
