apiVersion: apps/v1
kind: Deployment
metadata:
  name: kafka
  namespace: edgeone
spec:
  selector:
    matchLabels:
      app: kafka
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: kafka
    spec:
      securityContext:
        fsGroup: 1000
      volumes:
      - name: edgeone-kafka-pv
        persistentVolumeClaim:
          claimName: edgeone-kafka-pv-claim
      containers:
      - image: germanedge-docker.artifactory.new-solutions.com/edge-one/kafka:develop
        imagePullPolicy: Always
        name: kafka
        volumeMounts:
        - mountPath: /app/kafka-data
          name: edgeone-kafka-pv
          subPath: appkafka-data
        env:
        - name: KAFKA_ZOOKEEPER_CONNECT
          value: zookeeper:2181
        - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
          value: INSIDE:PLAINTEXT
        - name: KAFKA_ADVERTISED_LISTENERS
          value: INSIDE://kafka:9092
        - name: KAFKA_LISTENERS
          value: INSIDE://0.0.0.0:9092
        - name: KAFKA_PORT
          value: '9092'
        - name: KAFKA_INTER_BROKER_LISTENER_NAME
          value: INSIDE
        - name: BROKER_ID_COMMAND
          value: /app/getfreebrokerid.sh
        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
          value: '1'
        ports:
        - containerPort: 9092
        - containerPort: 7071
        resources:
          limits:
            memory: "2048M"
        args: []
        command: []
      imagePullSecrets:
      - name: artifactory
      nodeSelector:
        kubernetes.io/os: linux
