# TimeZone is used to set the environment variable TZ for pod, with UTC as the default.
timeZone: UTC

# This configuration is used to integrate with an external system DataDog.
# You can enable the integration by setting the enabled to true, e.g. datadog.log.enabled=true will enable datadog agent
# to collect the log.
datadog:
  log:
    enabled: false
    # besides the attributes you added, the chart will append "source" and "service" attributes to the log config.
    # see https://docs.datadoghq.com/containers/kubernetes/log/?tab=operator for more details.
    logConfig: '{}' # e.g. '{"app": "phoenixai", "tags": ["aa", "bb"]}'
  metrics:
    enabled: false

# This configuration is used to integrate with the external system Prometheus.
# The kube-anywhere chart renders ServiceMonitors for the cluster's own FE/BE/CN only; a warehouse
# is a separate release with its own Services, so it renders its own ServiceMonitor here. Its CN
# series carry the parent cluster's `cluster` label plus a `warehouse` label.
metrics:
  serviceMonitor:
    # Whether to expose metrics to Prometheus by ServiceMonitor.
    # Note: make sure the prometheus operator is installed in your cluster.
    enabled: false
    # Prometheus ServiceMonitor labels
    labels: {}
    # Prometheus ServiceMonitor interval
    interval: 15s

spec:
  # The name of phoenixai cluster, a must-have field.
  # Note:
  #   1. The phoenixai cluster must be an enterprise version.
  #   2. The phoenixai cluster must be created before the warehouse by operator
  #   3. The phoenixai cluster must run in shared-data mode.
  phoenixAIClusterName: ""

  # Number of replicas to deploy.
  # In the implementation of the operator: Even when both the replicas and autoScalingPolicy are set in the spec
  # field, the replicas field of the statefulset created by the operator will be set to null. This ensures that the replicas
  # field is controlled by HPA. Next, if a user's deployment, for example, does not involve changes to the statefulset,
  # then the pods will not be recreated.
  # Why should the replicas field in this values.yaml be set to null? This is the default replica. When the user removes
  # the autoScalingPolicy fields from the spec, the corresponding HPA object will be deleted. And when the replicas
  # field is set, the number of pods will immediately revert to the replicas count, even though the user did not specify
  # the replicas count in their own values.yaml.
  # replicas: 1
  image:
    # image sliced by "repository:tag"
    repository: us-west1-docker.pkg.dev/phoenix-ai-images/enterprise/cn-ubuntu
    # Note: the image tag must be greater than or equal to 3.2.0
    tag: 4.1.5-ee
  # serviceAccount for pod access cloud service.
  serviceAccount: ""
  # add annotations for pods. for example, if you want to config monitor for datadog, you can config the annotations.
  annotations: {}
  # If runAsNonRoot is true, the container is run as a non-root user.
  # The userId will be set to 1000, and the groupID will be set to 1000.
  runAsNonRoot: false
  # specify the service name and port config and serviceType
  # the service type refers https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
  service:
    # the service type only supported ClusterIP, NodePort, LoadBalancer
    type: "ClusterIP"
    # The static IP for the service when type is LoadBalancer and this field is not empty.
    # Note: the field name is loadbalancerIP (historical spelling), not loadBalancerIP.
    loadbalancerIP: ""
    # add annotations for external service.
    annotations: {}
    # add labels for external service.
    labels: {}
    # config the service port for service.
    # if you want to use a dedicated port for service, you can config the port.
    # see https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports for more details.
    ports: []
      # E.g., use a dedicated node port for service. The containerPort and port field can be commented out.
      # - name: webserver
      #   nodePort: 30040 # The range of valid ports is 30000-32767
      #   containerPort: 8040 # The port on the container to expose
      #   port: 8040 # The port to expose on the service
    # Specify how nodes distribute service traffic. Possible values: Cluster, Local.
    # Only applies when the type is NodePort or LoadBalancer. Local preserves the client source IP.
    externalTrafficPolicy: ""
  # imagePullSecrets allows you to use secrets for pulling images for your pods.
  imagePullSecrets: []
    # - name: "image-pull-secret"
  # If specified, the pod's nodeSelector — a map of nodeSelectors to match when scheduling pods on nodes.
  # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
  nodeSelector: {}
    # kubernetes.io/arch: amd64
    # kubernetes.io/os: linux
  # the pod labels for user select or classify pods.
  podLabels: {}
  ## hostAliases allows adding entries to /etc/hosts inside the containers
  hostAliases: []
    # - ip: "127.0.0.1"
    #   hostnames:
    #   - "example.com"
  # schedulerName allows you to specify which scheduler will be used for the pod
  schedulerName: ""
  # Additional container environment variables
  # You specify this manually like you would a raw deployment manifest.
  # This means you can bind in environment variables from secrets.
  # Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
  #
  # MYSQL_PWD is the one entry most warehouses need. A warehouse's compute nodes register themselves
  # in the cluster's FE over SQL as `root`, and this chart has no `initPassword` value of its own to
  # inherit the cluster's root password from. So on a cluster whose root HAS a password, set it here
  # or the compute node loops on `ERROR 1045 (28000): Access denied for user 'root'
  # (using password: NO)` and never becomes ready. Point it at the same Secret the cluster chart used
  # (phoenixai.initPassword.passwordSecret) so there is only one copy of the password:
  #   envVars:
  #     - name: MYSQL_PWD
  #       valueFrom:
  #         secretKeyRef:
  #           name: phoenixai-root-password
  #           key: password
  # Clusters whose root has no password need none of this - leave envVars unset.
  envVars: []
    # e.g. static environment variable:
    # - name: DEMO_GREETING
    #   value: "Hello from the environment"
    # e.g. secret environment variable:
    # - name: USERNAME
    #   valueFrom:
    #     secretKeyRef:
    #       name: mysecret
    #       key: username
  # affinity for pod scheduling.
  affinity: {}
    # nodeAffinity:
    #   requiredDuringSchedulingIgnoredDuringExecution:
    #     nodeSelectorTerms:
    #       - matchFields:
    #           - key: metadata.name
    #             operator: In
    #             values:
    #               - target-host-name
  # Node tolerations for pod scheduling to nodes with taints
  # Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
  tolerations: []
    # - key: "key"
    #   operator: "Equal|Exists"
    #   value: "value"
    #   effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
  # minReadySeconds specifies the minimum number of seconds for which a newly created pod should be ready
  # without any of its container crashing, for it to be considered available.
  # Defaults to 0 (pod will be considered available as soon as it is ready).
  # see https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#minimum-ready-seconds for more details.
  minReadySeconds: 0
  autoScalingPolicy: {}
    # If version is not set, the operator picks the HPA (Horizontal Pod Autoscaler) version
    # automatically based on your Kubernetes version: autoscaling/v2 on Kubernetes >= 1.26,
    # autoscaling/v2beta2 on older clusters. Only set it (v1, v2beta2, v2) to override that
    # choice — note that the v2beta2 API was removed in Kubernetes 1.26.
    # version: v2
    # maxReplicas: 10
    # minReplicas: 1
    # hpaPolicy:
    #   metrics:
    #   - type: Resource
    #     resource:
    #       name: memory
    #       target:
    #         averageUtilization: 30
    #         type: Utilization
    #   - type: Resource
    #     resource:
    #       name: cpu
    #       target:
    #         averageUtilization: 30
    #         type: Utilization
    #   behavior:
    #     scaleUp:
    #       policies:
    #       - type: Pods
    #         value: 1
    #         periodSeconds: 10
    #     scaleDown:
    #       selectPolicy: Disabled
  # define resource requests and limits for pods.
  resources:
    limits:
      cpu: 8
      memory: 8Gi
    requests:
      cpu: 4
      memory: 8Gi
  # the config for starting cn, the base information as follows.
  config: |
    sys_log_level = INFO
    # ports for admin, web, heartbeat service
    thrift_port = 9060
    webserver_port = 8040
    heartbeat_service_port = 9050
    brpc_port = 8060
  # mount secrets if necessary.
  # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
  secrets: []
    # e.g., mount my-secret to /etc/my-secret
    # - name: my-secret
    #   mountPath: /etc/my-secret
    #   subPath: ""
  # mount configmaps if necessary.
  # see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
  configMaps: []
    # e.g., mount my-configmap to /etc/my-configmap
    # - name: my-configmap
    #   mountPath: /etc/my-configmap
    #   subPath: ""
  # storageSpec for persistent data.
  storageSpec:
    # the name of volume for mount. if not will use emptyDir.
    name: ""
    # The storageClassName represent the used storageclass name. If not set will use k8s cluster default storageclass.
    # You must set a name when you set storageClassName
    storageClassName: ""
    storageSize: 100Gi
    # Setting this parameter can persist log storage
    logStorageSize: 1Gi
  # persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
  # See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/ for more information.
  persistentVolumeClaimRetentionPolicy:
    # whenDeleted: Delete
    # whenScaled: Delete

# create secrets if necessary.
secrets: []
  # e.g., create my-secret
  # - name: my-secret
  #   data:
  #     key: |
  #       this is the content of the secret
  #       when mounted, the key will be the name of the file

# create configmaps if necessary.
configMaps: []
  # e.g., create my-configmap
  # - name: my-configmap
  #   data:
  #     key: |
  #       this is the content of the configmap
  #       when mounted, the key will be the name of the file
