# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: platform.confluent.io/v1beta1
kind: Connect
metadata:
  name: connect
spec:
  replicas: 1
  tls:
    autoGeneratedCerts: true
  image:
    application: confluentinc/cp-enterprise-replicator:7.4.0
    init: confluentinc/confluent-init-container:2.6.0
  podTemplate:
    tolerations:
    - key: "app.stateful/component"
      operator: "Equal"
      value: "kafka-broker"
      effect: NoSchedule
    resources:
      requests:
        cpu: 500m
        memory: 1Gi
      requests:
        cpu: 1000m
        memory: 1Gi
  dependencies:
    kafka:
      bootstrapEndpoint: my-cluster.kafka.svc.cluster.local:9093
      tls:
        enabled: true
---
apiVersion: platform.confluent.io/v1beta1
kind: KsqlDB
metadata:
  name: ksqldb
spec:
  replicas: 1
  tls:
    autoGeneratedCerts: true
  image:
    application: confluentinc/cp-ksqldb-server:7.4.0
    init: confluentinc/confluent-init-container:2.6.0
  dataVolumeCapacity: 10Gi
  storageClass:
    name: premium-rwo
  podTemplate:
    tolerations:
    - key: "app.stateful/component"
      operator: "Equal"
      value: "kafka-broker"
      effect: NoSchedule
    resources:
      requests:
        cpu: 500m
        memory: 1Gi
      limits:
        cpu: 1000m
        memory: 1Gi
  dependencies:
    kafka:
      bootstrapEndpoint: my-cluster.kafka.svc.cluster.local:9093
      tls:
        enabled: true
---
apiVersion: platform.confluent.io/v1beta1
kind: SchemaRegistry
metadata:
  name: schemaregistry
spec:
  replicas: 1
  tls:
    autoGeneratedCerts: true
  image:
    application: confluentinc/cp-schema-registry:7.4.0
    init: confluentinc/confluent-init-container:2.6.0
  podTemplate:
    resources:
      requests:
        cpu: 500m
        memory: 1Gi
      limits:
        cpu: 1000m
        memory: 1Gi
  dependencies:
    kafka:
      bootstrapEndpoint: my-cluster.kafka.svc.cluster.local:9093
      tls:
        enabled: true
---
apiVersion: platform.confluent.io/v1beta1
kind: KafkaRestProxy
metadata:
  name: kafkarestproxy
spec:
  replicas: 1
  tls:
    autoGeneratedCerts: true
  image:
    application: confluentinc/cp-kafka-rest:7.4.0
    init: confluentinc/confluent-init-container:2.6.0
  podTemplate:
    resources:
      requests:
        cpu: 500m
        memory: 1Gi
      limits:
        cpu: 1000m
        memory: 1Gi
  dependencies:
    schemaRegistry:
      url: https://schemaregistry.kafka.svc.cluster.local:8081
      tls:
        enabled: true
---
apiVersion: platform.confluent.io/v1beta1
kind: ControlCenter
metadata:
  name: controlcenter
spec:
  replicas: 1
  tls:
    autoGeneratedCerts: true
  image:
    application: confluentinc/cp-enterprise-control-center:7.4.0
    init: confluentinc/confluent-init-container:2.6.0
  dataVolumeCapacity: 10Gi
  storageClass:
    name: premium-rwo
  #externalAccess:
  #  type: loadBalancer
  #  loadBalancer:
  #    domain: example.domain
  podTemplate:
    tolerations:
    - key: "app.stateful/component"
      operator: "Equal"
      value: "kafka-broker"
      effect: NoSchedule
    probe:
      readiness:
        periodSeconds: 30
        failureThreshold: 15
        timeoutSeconds: 10
        initialDelaySeconds: 240
      liveness:
        periodSeconds: 30
        failureThreshold: 5
        timeoutSeconds: 10
    resources:
      requests:
        cpu: 500m
        memory: 2Gi
      limits:
        cpu: 1000m
        memory: 2Gi
  dependencies:
    schemaRegistry:
      url: https://schemaregistry.kafka.svc.cluster.local:8081
      tls:
        enabled: true
    ksqldb:
    - name: ksql
      url: https://ksqldb.kafka.svc.cluster.local:8088
      tls:
        enabled: true
    connect:
    - name: connect
      url:  https://connect.kafka.svc.cluster.local:8083
      tls:
        enabled: true
