# For FE component, it needs to store metadata of StarRocks and FE log.
# For BE component, it needs to store data of StarRocks and BE log.
# For CN component, it needs to store cache data of StarRocks and CN log.
# By default, operator create an emptyDir storage volume for each metadata, data, and log.
# This manifest deploys a StarRocks cluster with other persistent storage volume.
#
# Note: you do not need to create the storage volume in advance.
#
# If storageClassName is left blank, the default storage class will be used. You can view
# available storage classes in the Kubernetes cluster with "kubectl get storageclass".
# Note: selecting an appropriate storage class is crucial as it dictates the type of storage volume.
# See https://kubernetes.io/docs/concepts/storage/persistent-volumes/ for more information.

apiVersion: starrocks.com/v1
kind: StarRocksCluster
metadata:
  name: freeleaps-starrocks-cluster
  namespace: freeleaps-data-platform
spec:
  starRocksFeSpec:
    image: starrocks/fe-ubuntu:latest
    replicas: 3
    limits:
      cpu: "1"
      memory: 2Gi
    requests:
      cpu: "0.5"
      memory: 1Gi
    storageVolumes:
      - name: fe-meta
        storageClassName: "azure-disk-std-lrs"
        storageSize: 25Gi # the size of storage volume for metadata
        mountPath: /opt/starrocks/fe/meta # the path of metadata
      - name: fe-log
        storageClassName: "azure-disk-std-lrs"
        storageSize: 25Gi # the size of storage volume for log
        mountPath: /opt/starrocks/fe/log # the path of log
  starRocksBeSpec:
    image: starrocks/be-ubuntu:latest
    replicas: 3
    limits:
      cpu: "2"
      memory: 4Gi
    requests:
      cpu: "1"
      memory: 2Gi
    storageVolumes:
      - name: be-data
        storageClassName: "azure-disk-std-lrs"
        storageSize: 25Gi # the size of storage volume for data
        mountPath: /opt/starrocks/be/storage # the path of data
      - name: be-log
        storageClassName: "azure-disk-std-lrs"
        storageSize: 25Gi # the size of storage volume for log
        mountPath: /opt/starrocks/be/log # the path of log
