apiVersion: v1
kind: Pod
metadata:
  name: randomlong-connector
spec:
  containers:
    - name: randomlong-connector
      image: confluentinc/cp-kafka-connect-base:5.2.1
      env:
      - name: CONNECT_GROUP_ID
        value: "connect-randomlong-cluster"
      - name: CONNECT_PLUGIN_PATH
        value: "/usr/share/java/kafka-connect-randomlong"
      - name: CONNECT_BOOTSTRAP_SERVERS
        value: "10.19.253.11:9092"
      - name: CONNECT_REST_ADVERTISED_HOST_NAME
        value: "(v1:status.podIP)"
      - 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: "org.apache.kafka.connect.storage.StringConverter"
      - name: CONNECT_VALUE_CONVERTER
        value: "org.apache.kafka.connect.storage.StringConverter"
      - name: CONNECT_KEY_CONVERTER_SCHEMAS_ENABLE
        value: "true"
      - name: CONNECT_VALUE_CONVERTER_SCHEMAS_ENABLE
        value: "true"
      - name: CONNECT_OFFSET_STORAGE_TOPIC
        value: "connect-randomlong-offsets"
      - name: CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR
        value: "1"
      - name: CONNECT_OFFSET_FLUSH_INTERVAL_MS
        value: "10000"
      - name: CONNECT_CONFIG_STORAGE_TOPIC
        value: "connect-randomlong-configs"
      - name: CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR
        value: "1"
      - name: CONNECT_STATUS_STORAGE_TOPIC
        value: "connect-randomlong-status"
      - name: CONNECT_STATUS_STORAGE_REPLICATION_FACTOR
        value: "1"
      - name: KAFKA_JMX_PORT
        value: "5555"
      ports:
        - containerPort: 8083
      volumeMounts:
        - name: workdir
          mountPath: /usr/share/java/kafka-connect-randomlong
  initContainers:
    - name: install-randomlong-connector
      image: openjdk:8
      command: ["/bin/bash","-c"]
      args: ["apt-get update; apt-get --assume-yes install git; cd home; git clone https://github.com/enfuse/kafka-connect.git; cd kafka-connect; ./gradlew shadowJar; cp connector/build/libs/connector-all.jar /data"]
      volumeMounts:
        - name: workdir
          mountPath: "/data"
  dnsPolicy: Default
  volumes:
    - name: workdir
      emptyDir: {}
