# Default values for clickhouse.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
global:
  podAntiAffinityLabelSelector: []
  podAntiAffinityTermLabelSelector: []
  podAffinityLabelSelector: []
  podAffinityTermLabelSelector: []
  nodeAffinityLabelSelector: []
  nodeAffinityTermLabelSelector: []
  password:
    clickhouse:

replicas: "1"
hostNetwork: "false"
dnsPolicy: "ClusterFirst"
podManagementPolicy: "OrderedReady"
image:
  repository: clickhouse/clickhouse-server
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: 22.8.6.71

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}
  # fsGroup: 2000

chmodContainer: 
  enabled: true
securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000
timezone: "Asia/Shanghai"
storageConfig:
  ## persistentVolumeClaim/hostPath
  generateType: "{{ if $.Values.global.allInOneLocalStorage }}hostPath{{ else }}{{$.Values.storageConfig.type}}{{end}}" #Please ignore this
  type: persistentVolumeClaim
  hostPath: /opt/deepflow-clickhouse
  persistence:
    - name: clickhouse-path
      accessModes:
       - ReadWriteOnce
      size: 100Gi
      annotations: 
      storageClass: ""
      # selector:
      #   matchLabels:
      #     app.kubernetes.io/name: clickhouse
    - name: clickhouse-storage-path
      accessModes:
       - ReadWriteOnce
      size: 200Gi
      annotations: 
      storageClass: ""
      # selector:
      #   matchLabels:
      #     app.kubernetes.io/name: clickhouse
    # - name: juicefs
    #   accessModes:
    #    - ReadWriteOnce
    #   size: 200Gi
    #   annotations: 
    #   storageClass: "juicefs"
    #   # selector:
    #   #   matchLabels:
    #   #     app.kubernetes.io/name: clickhouse
  s3StorageEnabled: false
  extraClickhousePath: []
  # - volumeName: juicefs
  #   mountPath: /juicefs
  #   diskName: juicefs
  #   preferNotToMerge: true 

clickhouse:
  interserverHttpPort: 9009
  maxConcurrentQueries: 2000
  ## 单次查询最大内存 (bytes)
  maxMemoryUsage: 10000000000
  maxQuerySize: 10737418240
  maxAstElements: 2000000
  maxExpandedAstElements: 2000000
  connectTimeout: 500
  backgroudPoolSize: 32
service:
  ## Configuration for Clickhouse service
  ##
  annotations: {}
  labels: {}
  clusterIP: ""

  ## Port for Clickhouse Service to listen on
  ##

  ports:
    - name: http-port
      port: 8123
      targetPort: 8123
      nodePort:
      protocol: TCP
    - name: tcp-port
      port: 9000
      targetPort: 9000
      nodePort:
      protocol: TCP
    - name: interserver-http-port
      port: 9009
      targetPort: 9009
      nodePort:
      protocol: TCP

  ## Additional ports to open for server service
  additionalPorts: []

  externalIPs: []
  loadBalancerIP: ""
  loadBalancerSourceRanges: []

  ## Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints
  ## must be Local
  externalTrafficPolicy: Cluster

  ## Service type
  ##
  type: ClusterIP


resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

nodeSelector: {}

tolerations: []

podAntiAffinityLabelSelector:
  - labelSelector:
    - key: app
      operator: In
      values: deepflow
    - key: component
      operator: In
      values: clickhouse
    topologyKey: "kubernetes.io/hostname"
podAntiAffinityTermLabelSelector: []
podAffinityLabelSelector: []
podAffinityTermLabelSelector: []
nodeAffinityLabelSelector: []
nodeAffinityTermLabelSelector: []