apiVersion: v1
kind: ConfigMap
metadata:
  name: clickhouse-config
  labels:
    app.kubernetes.io/instance: rybbit
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: rybbit
    helm.sh/chart: rybbit-5.0.1
  namespace: rybbit
data:
  enable_json.xml: |
    <clickhouse>
      <settings>
        <enable_json_type>1</enable_json_type>
      </settings>
    </clickhouse>
  logging_rules.xml: |
    <clickhouse>
      <logger>
        <level>warning</level>
        <console>true</console>
      </logger>
      <query_thread_log remove="remove"/>
      <query_log remove="remove"/>
      <text_log remove="remove"/>
      <trace_log remove="remove"/>
      <metric_log remove="remove"/>
      <asynchronous_metric_log remove="remove"/>
      <session_log remove="remove"/>
      <part_log remove="remove"/>
      <latency_log remove="remove"/>
      <processors_profile_log remove="remove"/>
    </clickhouse>
  metrics.xml: |
    <clickhouse>
      <prometheus>
        <endpoint>/metrics</endpoint>
        <port>9363</port>
        <metrics>true</metrics>
        <events>true</events>
        <asynchronous_metrics>true</asynchronous_metrics>
        <errors>true</errors>
      </prometheus>
    </clickhouse>
  network.xml: |
    <clickhouse>
      <listen_host>0.0.0.0</listen_host>
      <http_port>8123</http_port>
    </clickhouse>
  user_logging.xml: |
    <clickhouse>
      <profiles>
        <default>
          <log_queries>0</log_queries>
          <log_query_threads>0</log_query_threads>
          <log_processors_profiles>0</log_processors_profiles>
        </default>
      </profiles>
    </clickhouse>
