apiVersion: apps/v1
kind: Deployment
metadata:
  ownerReferences:
    - apiVersion: cloudflow-installer.lightbend.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Cloudflow
      name: __instanceId__
      uid: __instanceUid__
  name: strimzi-cluster-operator
  labels:
    app: strimzi
    chart: strimzi-kafka-operator-0.16.2
    component: deployment
    release: cloudflow
    heritage: Helm
spec:
  replicas: 1
  selector:
    matchLabels:
      name: strimzi-cluster-operator
      strimzi.io/kind: cluster-operator
  template:
    metadata:
      labels:
        name: strimzi-cluster-operator
        strimzi.io/kind: cluster-operator
    spec:
      serviceAccountName: strimzi-cluster-operator
      containers:
        - name: strimzi-cluster-operator
          image: __strimziOperator.imageName__:__strimziOperator.imageTag__
          args:
            - /opt/strimzi/bin/cluster_operator_run.sh
          env:
            - name: STRIMZI_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: STRIMZI_FULL_RECONCILIATION_INTERVAL_MS
              value: "120000"
            - name: STRIMZI_OPERATION_TIMEOUT_MS
              value: "300000"
            - name: STRIMZI_DEFAULT_TLS_SIDECAR_ENTITY_OPERATOR_IMAGE
              value: __kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_DEFAULT_TLS_SIDECAR_KAFKA_IMAGE
              value: __kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_DEFAULT_TLS_SIDECAR_ZOOKEEPER_IMAGE
              value: __kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_DEFAULT_KAFKA_EXPORTER_IMAGE
              value: __kafka.imageName__:__kafka.imageTag__
            # Cloudflow uses Kafka 2.4.0 only.
            # That's why only 2.4.0 image can be configurable
            # 2.3.1 image, although not used, still needs to be provided or Strimzi will complain
            - name: STRIMZI_KAFKA_IMAGES
              value: |
                2.3.1=strimzi/kafka:0.16.2-kafka-2.3.1
                2.4.0=__kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_KAFKA_CONNECT_IMAGES
              value: |
                2.3.1=strimzi/kafka:0.16.2-kafka-2.3.1
                2.4.0=__kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_KAFKA_CONNECT_S2I_IMAGES
              value: |
                2.3.1=strimzi/kafka:0.16.2-kafka-2.3.1
                2.4.0=__kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_KAFKA_MIRROR_MAKER_IMAGES
              value: |
                2.3.1=strimzi/kafka:0.16.2-kafka-2.3.1
                2.4.0=__kafka.imageName__:__kafka.imageTag__
            - name: STRIMZI_DEFAULT_TOPIC_OPERATOR_IMAGE
              value: __strimziOperator.imageName__:__strimziOperator.imageTag__
            - name: STRIMZI_DEFAULT_USER_OPERATOR_IMAGE
              value: __strimziOperator.imageName__:__strimziOperator.imageTag__
            - name: STRIMZI_DEFAULT_KAFKA_INIT_IMAGE
              value: __strimziOperator.imageName__:__strimziOperator.imageTag__
            - name: STRIMZI_LOG_LEVEL
              value: "INFO"

          livenessProbe:
            httpGet:
              path: /healthy
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 30
          readinessProbe:
            httpGet:
              path: /ready
              port: 8080
            initialDelaySeconds: 10
            periodSeconds: 30
          resources:
            limits:
              cpu: 1000m
              memory: 256Mi
            requests:
              cpu: 200m
              memory: 256Mi
  strategy:
    type: Recreate
