--- # Version 2021.9.14.001
apiVersion: apps/v1
kind: Deployment
metadata:
  name: broker-2-deploy
  labels:
    app: broker-2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: broker-2
  strategy: {}
  template:
    metadata:
      labels:
        app: broker-2
    spec:
      containers:
      - name: broker-2
        image: confluentinc/cp-server:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 9093
        env:
        - name: CONFLUENT_METRICS_ENABLE
          value: "true"
        - name: CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS
          value: localhost:9093
        - name: CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS
          value: "1"
        - name: CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT
          value: zookeeper:2181
        - name: CONFLUENT_SCHEMA_REGISTRY_URL
          value: http://schema-registry:8081
        - name: CONFLUENT_SUPPORT_CUSTOMER_ID
          value: anonymous
        - name: KAFKA_ADVERTISED_HOST_NAME
          value: broker-2
        - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
          value: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
        - name: KAFKA_LISTENERS
          value: PLAINTEXT://0.0.0.0:29093,PLAINTEXT_HOST://0.0.0.0:9093
        - name: KAFKA_ADVERTISED_LISTENERS
          value: PLAINTEXT://broker-2:29093,PLAINTEXT_HOST://broker-2:9093
        - name: KAFKA_BROKER_ID
          value: "2"
        - name: KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR
          value: "1"
        - name: KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS
          value: "0"
        - name: KAFKA_METRIC_REPORTERS
          value: io.confluent.metrics.reporter.ConfluentMetricsReporter
        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
          value: "1"
        - name: KAFKA_ZOOKEEPER_CONNECT
          value: zookeeper:2181
        resources:
          requests:
            memory: "1.5Gi"
            cpu: "500m"
          limits:
            memory: "2Gi"
            cpu: "1"
