apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: kafka-broker
  labels:
    app: kafka
    component: kafka-broker
spec:
  serviceName: "kafka-broker"
  replicas: 1
  selector:
    matchLabels:
      app: kafka
  template:
    metadata:
      labels:
        app: kafka
        component: kafka-broker
    spec:
      containers:
      - name: kafka
        image: confluentinc/cp-kafka:5.5.2
        ports:
        - containerPort: 9092
        env:
          - name: KAFKA_LISTENERS
            value: "PLAINTEXT://:9092"
          - name: KAFKA_ADVERTISED_LISTENERS
            value: "PLAINTEXT://kafka-broker:9092"
          - name: KAFKA_ZOOKEEPER_CONNECT
            value: kafka-zk:2181
          - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
            value: "1"
          - name: KAFKA_LOG4J_ROOT_LOGLEVEL
            value: "DEBUG"
          - name: KAFKA_LOG4J_LOGGERS
            value: "org.apache.zookeeper=ERROR,org.apache.kafka=ERROR,kafka=ERROR,kafka.cluster=ERROR,kafka.controller=ERROR,kafka.coordinator=ERROR,kafka.log=ERROR,kafka.server=ERROR,kafka.zookeeper=ERROR,state.change.logger=ERROR"

