apiVersion: v1
kind: ReplicationController
metadata:
  name: kafka
  labels:
    name: kafka-rc
    tool: kafka

spec:
  replicas: 1
  selector:
    name: kafka
    server: kafka-server
  template:
    metadata:
      labels:
        name: kafka
        server: kafka-server
    spec:
      containers:
      - name: kafka
        image: wurstmeister/kafka
        # command:
        #   - /run.sh
        # resources:
        #   limits:
        #     cpu: 0.1

        env:
          - name: KAFKA_PORT
            value: "9092"
          - name: KAFKA_ADVERTISED_PORT
            value: "9092"
          - name: KAFKA_ZOOKEEPER_CONNECT
            value: zookeeper-svc-1:2181,zookeeper-svc-2:2181,zookeeper-svc-3:2181
          - name: KAFKA_ADVERTISED_HOST_NAME
            valueFrom:
              fieldRef:
                fieldPath: status.podIP

        ports:
          - containerPort: 9092
            hostPort: 9092
            name: server

        imagePullPolicy: IfNotPresent
