apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
  name: controller
  namespace: {{ include "kafka-cluster.namespace" . }}
  labels:
    strimzi.io/cluster: {{ include "kafka-cluster.fullname" . }}
    {{- include "kafka-cluster.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.controller.replicas }}
  roles:
    - controller
  storage:
    type: jbod
    volumes:
      - id: 0
        type: persistent-claim
        size: {{ .Values.controller.storage.size }}
        kraftMetadata: shared
        class: {{ .Values.controller.storage.class | quote }}
  {{- if and .Values.controller.resources (or .Values.controller.resources.requests .Values.controller.resources.limits) }}
  resources:
    {{- if .Values.controller.resources.requests }}
    requests:
      cpu: {{ .Values.controller.resources.requests.cpu }}
      memory: {{ .Values.controller.resources.requests.memory }}
    {{- end }}
    {{- if .Values.controller.resources.limits }}
    limits:
      cpu: {{ .Values.controller.resources.limits.cpu }}
      memory: {{ .Values.controller.resources.limits.memory }}
    {{- end }}
  {{- end }}