apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
  name: freeleaps-kafka-cluster-controllers
  namespace: freeleaps-data-platform
  labels:
    strimzi.io/cluster: freeleaps-kafka-cluster
spec:
  replicas: 3
  roles:
    - controller
  storage:
    type: jbod
    volumes:
      - id: 0
        type: persistent-claim
        size: 25Gi
        deleteClaim: false
        kraftMetadata: shared
        class: azure-disk-std-ssd-lrs
  resources:
    requests:
      cpu: 500m
      memory: 512Mi
    limits:
      cpu: "2"
      memory: 2Gi
---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
  name: freeleaps-kafka-cluster-brokers
  namespace: freeleaps-data-platform
  labels:
    strimzi.io/cluster: freeleaps-kafka-cluster
spec:
  replicas: 3
  roles:
    - broker
  storage:
    type: jbod
    volumes:
      - id: 0
        type: persistent-claim
        size: 25Gi
        deleteClaim: false
        kraftMetadata: shared
        class: azure-disk-std-ssd-lrs
  resources:
    requests:
      cpu: 500m
      memory: 2Gi
    limits:
      cpu: "2"
      memory: 4Gi
---
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: freeleaps-kafka-cluster
  namespace: freeleaps-data-platform
  annotations:
    strimzi.io/node-pools: enabled
    strimzi.io/kraft: enabled
spec:
  kafka:
    version: 4.0.0
    metadataVersion: 4.0-IV3
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
        authentication:
          type: scram-sha-512
      - name: tls
        port: 9093
        type: internal
        tls: true
        authentication:
          type: scram-sha-512
    config:
      offsets.topic.replication.factor: 1
      transaction.state.log.replication.factor: 1
      transaction.state.log.min.isr: 1
      default.replication.factor: 1
      min.insync.replicas: 1
    authorization:
      type: simple
      superUsers:
        - freeleaps-user
  entityOperator:
    topicOperator: {}
    userOperator: {}
---
apiVersion: v1
kind: Secret
metadata:
  name: freeleaps-user-passwords
  namespace: freeleaps-data-platform
type: Opaque
data:
  client-passwords: eHpqbzFVZEE3eHM5ZDNEREhaME5nYVJvQndkaHh5QkU=
---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
  name: freeleaps-user
  namespace: freeleaps-data-platform
  labels:
    strimzi.io/cluster: freeleaps-kafka-cluster
spec:
  authentication:
    type: scram-sha-512
    password:
      valueFrom:
        secretKeyRef:
          name: freeleaps-user-passwords
          key: client-passwords
  authorization:
    type: simple
    acls:
      - resource:
          type: topic
          name: "*"
          patternType: literal
        host: "*"
        operations:
        - All
      - resource:
          type: group
          name: "*"
          patternType: literal
        operations:
        - All
        - Delete
        host: "*"
