# This manifest deploys a PhoenixAI cluster with FE, CN, FE Proxy
# To load data from outside the Kubernetes cluster into StarRocks deployed within the Kubernetes
# cluster, you can deploy the FE Proxy component. So that External data import tools, like flink,
# can use the STREAM LOAD syntax to import data into PhoenixAI clusters.
# see https://docs.starrocks.io/docs/loading/Flink-connector-starrocks/ for more information
# about how to use flink to import data into StarRocks.

apiVersion: phoenixdata.ai/v1
kind: PhoenixAICluster
metadata:
  name: a-phoenixai-with-fe-proxy   # 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
    service:
      type: NodePort   # export fe service
      ports:
      - name: query   # fill the name from the fe service ports
        nodePort: 32755
        port: 9030
        containerPort: 9030
  phoenixAICnSpec:
    image: us-west1-docker.pkg.dev/phoenix-ai-images/enterprise/cn-ubuntu:4.1.5-ee
    replicas: 3
    limits:
      cpu: 16
      memory: 64Gi
    requests:
      cpu: 16
      memory: 64Gi
  phoenixAIFeProxySpec:
    replicas: 1
    limits:
      cpu: 1
      memory: 2Gi
    requests:
      cpu: 1
      memory: 2Gi
    service:
      type: NodePort   # export fe proxy service
      ports:
        - name: http-port   # fill the name from the fe proxy service ports
          containerPort: 8080
          nodePort: 30180   # The range of valid ports is 30000-32767
          port: 8080
    resolver: "kube-dns.kube-system.svc.cluster.local"  # this is the default dns server.
