apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnect
metadata:
  annotations:
    strimzi.io/use-connector-resources: 'true'
    "helm.sh/hook": post-install,post-upgrade
  name: {{ .Values.kafkaConnectConf.clusterName }}
spec:
  template:
    pod:
      metadata:
        annotations:
          sidecar.istio.io/inject: "false"
        labels:
          collect.logs: "plain-text"
  bootstrapServers: 'kafka-cluster-kafka-bootstrap:9092'
  metricsConfig:
    type: jmxPrometheusExporter
    valueFrom:
      configMapKeyRef:
        name: kafka-connect-metrics-config
        key: kafka-connect-metrics-config.yml
  config:
    config.providers: 'env'
    config.providers.env.class: 'io.strimzi.kafka.EnvVarConfigProvider'
    config.storage.topic: 'connect-cluster-configs'
    group.id: 'connect-cluster'
    offset.storage.topic: 'connect-cluster-offsets'
    status.storage.topic: 'connect-cluster-status'
    config.storage.replication.factor: {{ .Values.global.kafkaOperator.replicationFactor }}
    offset.storage.replication.factor: {{ .Values.global.kafkaOperator.replicationFactor }}
    status.storage.replication.factor: {{ .Values.global.kafkaOperator.replicationFactor }}
  externalConfiguration:
    env:
      - name: DB_USER
        valueFrom:
          secretKeyRef:
            key: {{ .Values.kafkaConnectConf.auditUserKey }}
            name: {{ .Values.kafkaConnectConf.auditSecretName }}
      - name: DB_PASSWORD
        valueFrom:
          secretKeyRef:
            key: {{ .Values.kafkaConnectConf.auditPasswordKey }}
            name: {{ .Values.kafkaConnectConf.auditSecretName }}
  image: {{ .Values.image.name }}:{{ .Values.image.version }}
  replicas: 1
  version: 3.0.0
