apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    meta.helm.sh/release-name: think-confluent
    meta.helm.sh/release-namespace: kafka
  labels:
    app: cp-kafka-connect
    app.kubernetes.io/managed-by: Helm
    chart: cp-kafka-connect-0.1.0
    heritage: Helm
    release: think-confluent
  name: think-confluent-cp-kafka-connect
  namespace: kafka
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: cp-kafka-connect
      release: think-confluent
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        prometheus.io/port: "5556"
        prometheus.io/scrape: "true"
      labels:
        app: cp-kafka-connect
        release: think-confluent
    spec:
      containers:
        - command:
            - java
            - -XX:+UnlockExperimentalVMOptions
            - -XX:+UseCGroupMemoryLimitForHeap
            - -XX:MaxRAMFraction=1
            - -XshowSettings:vm
            - -jar
            - jmx_prometheus_httpserver.jar
            - "5556"
            - /etc/jmx-kafka-connect/jmx-kafka-connect-prometheus.yml
          image: solsson/kafka-prometheus-jmx-exporter@sha256:6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143
          imagePullPolicy: IfNotPresent
          name: prometheus-jmx-exporter
          ports:
            - containerPort: 5556
              protocol: TCP
          resources: { }
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /etc/jmx-kafka-connect
              name: jmx-config
        - env:
            - name: CONNECT_REST_ADVERTISED_HOST_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.podIP
            - name: CONNECT_BOOTSTRAP_SERVERS
              value: PLAINTEXT://think-confluent-cp-kafka-headless:9092
            - name: CONNECT_GROUP_ID
              value: think-confluent
            - name: CONNECT_CONFIG_STORAGE_TOPIC
              value: think-confluent-cp-kafka-connect-config
            - name: CONNECT_OFFSET_STORAGE_TOPIC
              value: think-confluent-cp-kafka-connect-offset
            - name: CONNECT_STATUS_STORAGE_TOPIC
              value: think-confluent-cp-kafka-connect-status
            - name: CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL
              value: http://think-confluent-cp-schema-registry:8081
            - name: CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL
              value: http://think-confluent-cp-schema-registry:8081
            - name: KAFKA_HEAP_OPTS
              value: -Xms512M -Xmx512M
            - name: CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR
              value: "3"
            - name: CONNECT_INTERNAL_KEY_CONVERTER
              value: org.apache.kafka.connect.json.JsonConverter
            - name: CONNECT_INTERNAL_VALUE_CONVERTER
              value: org.apache.kafka.connect.json.JsonConverter
            - name: CONNECT_KEY_CONVERTER
              value: io.confluent.connect.avro.AvroConverter
            - name: CONNECT_KEY_CONVERTER_SCHEMAS_ENABLE
              value: "false"
            - name: CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR
              value: "3"
            - name: CONNECT_PLUGIN_PATH
              value: /usr/share/java,/usr/share/confluent-hub-components
            - name: CONNECT_STATUS_STORAGE_REPLICATION_FACTOR
              value: "3"
            - name: CONNECT_VALUE_CONVERTER
              value: io.confluent.connect.avro.AvroConverter
            - name: CONNECT_VALUE_CONVERTER_SCHEMAS_ENABLE
              value: "false"
            - name: KAFKA_JMX_PORT
              value: "5555"
          image: confluentinc/cp-kafka-connect:5.5.0
          imagePullPolicy: IfNotPresent
          name: cp-kafka-connect-server
          ports:
            - containerPort: 8083
              name: kafka-connect
              protocol: TCP
            - containerPort: 5555
              name: jmx
              protocol: TCP
          resources: { }
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: { }
      terminationGracePeriodSeconds: 30
      volumes:
        - configMap:
            defaultMode: 420
            name: think-confluent-cp-kafka-connect-jmx-configmap
          name: jmx-config