# For FE component, it needs to store metadata of StarRocks and FE 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 PhoenixAI 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: phoenixdata.ai/v1
kind: PhoenixAICluster
metadata:
  name: a-phoenixai-with-persistent-storage   # change the name if needed.
spec:
  phoenixAIFeSpec:
    image: us-west1-docker.pkg.dev/phoenix-ai-images/enterprise/fe-ubuntu:4.1.5-ee
    replicas: 3
    limits:
      cpu: 8
      memory: 16Gi
    requests:
      cpu: 8
      memory: 16Gi
    storageVolumes:
    - name: fe-meta
      # storageClassName: ""  # if storageClassName is not set, the default storage class will be used
      storageSize: 10Gi   # the size of storage volume for metadata
      mountPath: /opt/starrocks/fe/meta   # the path of metadata
    - name: fe-log
      # storageClassName: ""  # if storageClassName is not set, the default storage class will be used
      storageSize: 1Gi    # the size of storage volume for log
      mountPath: /opt/starrocks/fe/log    # the path of log
  phoenixAICnSpec:
    image: us-west1-docker.pkg.dev/phoenix-ai-images/enterprise/cn-ubuntu:4.1.5-ee
    replicas: 1
    limits:
      cpu: 16
      memory: 64Gi
    requests:
      cpu: 16
      memory: 64Gi
    storageVolumes:
    - name: cn-data
      # storageClassName: ""  # if storageClassName is not set, the default storage class will be used
      storageSize: 10Gi   # the size of storage volume for data
      mountPath: /opt/starrocks/cn/storage  # the path of data
    - name: cn-log
      # storageClassName: ""  # if storageClassName is not set, the default storage class will be used
      storageSize: 1Gi  # the size of storage volume for log
      mountPath: /opt/starrocks/cn/log  # the path of log
