---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: twitter-stream-connect
  name: twitter-stream-connect
  namespace: kafka
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app:  twitter-stream-connect
  template:
    metadata:
      labels:
        app:  twitter-stream-connect
    spec:
      containers:
        - name:  twitter-stream-connect
          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"