apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: {{ .Release.Name }}
  labels:
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
  kafka:
    replicas: {{ .Values.kafka.replicas }}
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
      - name: tls
        port: 9093
        type: internal
        tls: true
      - name: external
        port: 9094
        {{- if .Values.external }}
        type: loadbalancer
        {{- else }}
        type: internal
        {{- end }}
        tls: false
    config:
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 2
      default.replication.factor: 3
      min.insync.replicas: 2
    storage:
      type: jbod
      volumes:
      - id: 0
        type: persistent-claim
        {{- with .Values.kafka.size }}
        size: {{ . }}
        {{- end }}
        deleteClaim: true
  zookeeper:
    replicas: {{ .Values.zookeeper.replicas }}
    storage:
      type: persistent-claim
      {{- with .Values.zookeeper.size }}
      size: {{ . }}
      {{- end }}
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}
