2# commonLabels -- set of labels that will be applied to all the resources for the operator
4# commonAnnotations -- set of annotations that will be applied to all the resources for the operator
7 # look details in `kubectl explain deployment.spec.strategy`
11 # crdHook.enabled -- enable automatic CRD installation/update via pre-install/pre-upgrade hooks
12 # when disabled, CRDs must be installed manually using kubectl apply
15 # crdHook.image.repository -- image repository for CRD installation job
16 repository: chainreg.biz/chainguard-private/kubectl
17 # crdHook.image.tag -- image tag for CRD installation job
18 tag: latest-dev@sha256:19c23266240686468098e30d6160fe904135c8820fa012ece3ee16265b2f1bab
19 # crdHook.image.pullPolicy -- image pull policy for CRD installation job
20 pullPolicy: IfNotPresent
21 # crdHook.imagePullSecrets -- image pull secrets for CRD installation job
22 # possible value format `[{"name":"your-secret-name"}]`,
23 # check `kubectl explain pod.spec.imagePullSecrets` for details
25 # crdHook.resources -- resource limits and requests for CRD installation job
33 # crdHook.nodeSelector -- node selector for CRD installation job
35 # crdHook.tolerations -- tolerations for CRD installation job
37 # crdHook.affinity -- affinity for CRD installation job
39 # crdHook.annotations -- additional annotations for CRD installation job
41 # crdHook.containerSecurityContext -- container security context for CRD installation job
42 # check `kubectl explain pod.spec.containers.securityContext` for details
43 containerSecurityContext: {}
44 # allowPrivilegeEscalation: false
50 # type: RuntimeDefault
53 # operator.image.registry -- optional image registry prefix (e.g. 1234567890.dkr.ecr.us-east-1.amazonaws.com)
55 # operator.image.repository -- image repository
56 repository: chainreg.biz/chainguard-private/clickhouse-operator
57 # operator.image.tag -- image tag (chart's appVersion value will be used if not set)
58 tag: latest@sha256:3c0fdf2ccaecc508f614209be709e594018027e21906795ab4f572796ef9c997
59 # operator.image.pullPolicy -- image pull policy
60 pullPolicy: IfNotPresent
61 containerSecurityContext: {}
62 # operator.resources -- custom resource configuration, check `kubectl explain pod.spec.containers.resources` for details
71 # operator.priorityClassName -- priority class name for the clickhouse-operator deployment, check `kubectl explain pod.spec.priorityClassName` for details
74 # operator.env -- additional environment variables for the clickhouse-operator container in deployment
75 # possible format value `[{"name": "SAMPLE", "value": "text"}]`
77 # operator.livenessProbe -- optional liveness probe for the clickhouse-operator container
78 # check `kubectl explain pod.spec.containers.livenessProbe` for details
83 # initialDelaySeconds: 10
86 # operator.readinessProbe -- optional readiness probe for the clickhouse-operator container
87 # check `kubectl explain pod.spec.containers.readinessProbe` for details
92 # initialDelaySeconds: 5
98 # metrics.image.registry -- optional image registry prefix (e.g. 1234567890.dkr.ecr.us-east-1.amazonaws.com)
100 # metrics.image.repository -- image repository
101 repository: chainreg.biz/chainguard-private/clickhouse-operator-metrics-exporter
102 # metrics.image.tag -- image tag (chart's appVersion value will be used if not set)
103 tag: latest@sha256:d716977557dd5a74b7266ae685b0fd3675d01bd79ced5169c3fd16e1e683593d
104 # metrics.image.pullPolicy -- image pull policy
105 pullPolicy: IfNotPresent
106 containerSecurityContext: {}
107 # metrics.resources -- custom resource configuration
116 # metrics.env -- additional environment variables for the deployment of metrics-exporter containers
117 # possible format value `[{"name": "SAMPLE", "value": "text"}]`
119 # metrics.livenessProbe -- optional liveness probe for the metrics-exporter container
120 # check `kubectl explain pod.spec.containers.livenessProbe` for details
125 # initialDelaySeconds: 10
128 # metrics.readinessProbe -- optional readiness probe for the metrics-exporter container
129 # check `kubectl explain pod.spec.containers.readinessProbe` for details
134 # initialDelaySeconds: 5
137# imagePullSecrets -- image pull secret for private images in clickhouse-operator pod
138# possible value format `[{"name":"your-secret-name"}]`,
139# check `kubectl explain pod.spec.imagePullSecrets` for details
141# podLabels -- labels to add to the clickhouse-operator pod
143# podAnnotations -- annotations to add to the clickhouse-operator pod, check `kubectl explain pod.spec.annotations` for details
144# @default -- check the `values.yaml` file
146 prometheus.io/port: '8888'
147 prometheus.io/scrape: 'true'
148 clickhouse-operator-metrics/port: '9999'
149 clickhouse-operator-metrics/scrape: 'true'
150# nameOverride -- override name of the chart
152# fullnameOverride -- full name of the chart.
155 # serviceAccount.create -- specifies whether a service account should be created
157 # serviceAccount.annotations -- annotations to add to the service account
159 # serviceAccount.name -- the name of the service account to use; if not set and create is true, a name is generated using the fullname template
162 # rbac.create -- specifies whether rbac resources should be created
164 # rbac.namespaceScoped -- specifies whether to create roles and rolebindings at the cluster level or namespace level
165 namespaceScoped: false
167 # secret.create -- create a secret with operator credentials
169 # secret.username -- operator credentials username
170 username: clickhouse_operator
171 # secret.password -- operator credentials password
172 password: clickhouse_operator_password
173# nodeSelector -- node for scheduler pod assignment, check `kubectl explain pod.spec.nodeSelector` for details
175# tolerations -- tolerations for scheduler pod assignment, check `kubectl explain pod.spec.tolerations` for details
177# affinity -- affinity for scheduler pod assignment, check `kubectl explain pod.spec.affinity` for details
179# podSecurityContext - operator deployment SecurityContext, check `kubectl explain pod.spec.securityContext` for details
180podSecurityContext: {}
181# topologySpreadConstraints - topologySpreadConstraints affinity for scheduler pod assignment, check `kubectl explain pod.spec.topologySpreadConstraints` for details
182topologySpreadConstraints: []
184 # serviceMonitor.enabled -- ServiceMonitor Custom resource is created for a [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)
185 # In serviceMonitor will be created two endpoints ch-metrics on port 8888 and op-metrics # 9999. Ypu can specify interval, scrapeTimeout, relabelings, metricRelabelings for each endpoint below
187 # serviceMonitor.additionalLabels -- additional labels for service monitor
190 # serviceMonitor.interval for ch-metrics endpoint --
192 # serviceMonitor.scrapeTimeout for ch-metrics endpoint -- Prometheus ServiceMonitor scrapeTimeout. If empty, Prometheus uses the global scrape timeout unless it is less than the target's scrape interval value in which the latter is used.
194 # serviceMonitor.relabelings for ch-metrics endpoint -- Prometheus [RelabelConfigs] to apply to samples before scraping
196 # serviceMonitor.metricRelabelings for ch-metrics endpoint -- Prometheus [MetricRelabelConfigs] to apply to samples before ingestio
197 metricRelabelings: []
199 # serviceMonitor.interval for op-metrics endpoint --
201 # serviceMonitor.scrapeTimeout for op-metrics endpoint -- Prometheus ServiceMonitor scrapeTimeout. If empty, Prometheus uses the global scrape timeout unless it is less than the target's scrape interval value in which the latter is used.
203 # serviceMonitor.relabelings for op-metrics endpoint -- Prometheus [RelabelConfigs] to apply to samples before scraping
205 # serviceMonitor.metricRelabelings for op-metrics endpoint -- Prometheus [MetricRelabelConfigs] to apply to samples before ingestio
206 metricRelabelings: []
207# configs -- clickhouse operator configs
208# @default -- check the `values.yaml` file for the config content (auto-generated from latest operator release)
212 01-clickhouse-01-listen.xml: |
214 <!-- This file is auto-generated -->
215 <!-- Do not edit this file - all changes would be lost -->
216 <!-- Edit appropriate template in the following folder: -->
217 <!-- deploy/builder/templates-config -->
220 <!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
221 <listen_host>::</listen_host>
222 <listen_host>0.0.0.0</listen_host>
223 <listen_try>1</listen_try>
225 01-clickhouse-02-logger.xml: |
227 <!-- This file is auto-generated -->
228 <!-- Do not edit this file - all changes would be lost -->
229 <!-- Edit appropriate template in the following folder: -->
230 <!-- deploy/builder/templates-config -->
234 <!-- Possible levels: https://github.com/pocoproject/poco/blob/devel/Foundation/include/Poco/Logger.h#L439 -->
236 <log>/var/log/clickhouse-server/clickhouse-server.log</log>
237 <errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
240 <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
244 01-clickhouse-03-query_log.xml: |
246 <!-- This file is auto-generated -->
247 <!-- Do not edit this file - all changes would be lost -->
248 <!-- Edit appropriate template in the following folder: -->
249 <!-- deploy/builder/templates-config -->
252 <query_log replace="1">
253 <database>system</database>
254 <table>query_log</table>
255 <engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day</engine>
256 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
258 <query_thread_log remove="1"/>
260 01-clickhouse-04-part_log.xml: |
262 <!-- This file is auto-generated -->
263 <!-- Do not edit this file - all changes would be lost -->
264 <!-- Edit appropriate template in the following folder: -->
265 <!-- deploy/builder/templates-config -->
268 <part_log replace="1">
269 <database>system</database>
270 <table>part_log</table>
271 <engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day</engine>
272 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
275 01-clickhouse-05-trace_log.xml: |-
277 <!-- This file is auto-generated -->
278 <!-- Do not edit this file - all changes would be lost -->
279 <!-- Edit appropriate template in the following folder: -->
280 <!-- deploy/builder/templates-config -->
283 <trace_log replace="1">
284 <database>system</database>
285 <table>trace_log</table>
286 <engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 30 day</engine>
287 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
293 # This file is auto-generated
294 # Do not edit this file - all changes would be lost
295 # Edit appropriate template in the following folder:
296 # deploy/builder/templates-config
299 # Template parameters available:
303 # CH_CREDENTIALS_SECRET_NAMESPACE=
304 # CH_CREDENTIALS_SECRET_NAME=clickhouse-operator
307 ################################################
311 ################################################
313 # Namespaces where clickhouse-operator watches for events.
314 # Concurrently running operators should watch on different namespaces.
315 # `include` and `exclude` accept literal namespace names or regexp patterns.
316 # Empty `include` watches the operator's own namespace (or all namespaces when
317 # the operator runs in `kube-system`); use [".*"] to force watch-all elsewhere.
318 # Empty `exclude` matches none. `exclude` is applied after `include`.
322 # Behavior when ClickHouseOperatorConfiguration changes: none | restart
327 ################################################
329 ## Configuration files section
331 ################################################
333 # Each 'path' can be either absolute or relative.
334 # In case path is absolute - it is used as is
335 # In case path is relative - it is relative to the folder where configuration file you are reading right now is located.
337 # Path to the folder where ClickHouse configuration files common for all instances within a CHI are located.
339 # Path to the folder where ClickHouse configuration files unique for each instance (host) within a CHI are located.
341 # Path to the folder where ClickHouse configuration files with users' settings are located.
342 # Files are common for all instances within a CHI.
344 ################################################
346 ## Configuration users section
348 ################################################
350 # Default settings for user accounts, created by the operator.
351 # IMPORTANT. These are not access credentials or settings for 'default' user account,
352 # it is a template for filling out missing fields for all user accounts to be created by the operator,
353 # with the following EXCEPTIONS:
354 # 1. 'default' user account DOES NOT use provided password, but uses all the rest of the fields.
355 # Password for 'default' user account has to be provided explicitly, if to be used.
356 # 2. CHOP user account DOES NOT use:
357 # - profile setting. It uses predefined profile called 'clickhouse_operator'
358 # - quota setting. It uses empty quota name.
359 # - networks IP setting. Operator specifies 'networks/ip' user setting to match operators' pod IP only.
360 # - password setting. Password for CHOP account is used from 'clickhouse.access.*' section
362 # Default values for ClickHouse user account(s) created by the operator
363 # 1. user/profile - string
364 # 2. user/quota - string
365 # 3. user/networks/ip - multiple strings
366 # 4. user/password - string
367 # These values can be overwritten on per-user basis.
374 ################################################
376 ## Configuration network section
378 ################################################
380 # Default host_regexp to limit network connectivity from outside
381 hostRegexpTemplate: "(chi-{chi}-[^.]+\\d+-\\d+|clickhouse\\-{chi})\\.{namespace}\\.svc\\.cluster\\.local$"
382 ################################################
384 ## Configuration restart policy section
385 ## Configuration restart policy describes what configuration changes require ClickHouse restart
387 ################################################
388 configurationRestartPolicy:
391 # Special version of "*" - default version - has to satisfy all ClickHouse versions.
392 # Default version will also be used in case ClickHouse version is unknown.
393 # ClickHouse version may be unknown due to host being down - for example, because of incorrect "settings" section.
394 # ClickHouse is not willing to start in case incorrect/unknown settings are provided in config file.
397 # see https://kb.altinity.com/altinity-kb-setup-and-maintenance/altinity-kb-server-config-files/#server-config-configxml-sections-which-dont-require-restart
398 # to be replaced with "select * from system.server_settings where changeable_without_restart = 'No'"
401 - settings/access_control_path: "no"
402 - settings/dictionaries_config: "no"
403 - settings/max_server_memory_*: "no"
404 - settings/max_*_to_drop: "no"
405 - settings/max_concurrent_queries: "no"
406 - settings/models_config: "no"
407 - settings/user_defined_executable_functions_config: "no"
409 - settings/logger/*: "no"
410 - settings/macros/*: "no"
411 - settings/remote_servers/*: "no"
412 - settings/user_directories/*: "no"
413 # these settings should not lead to pod restarts
414 - settings/display_secrets_in_show_and_select: "no"
417 - files/config.d/*.xml: "yes"
418 - files/config.d/*dict*.xml: "no"
419 - files/config.d/*no_restart*: "no"
420 # exceptions in default profile
421 - profiles/default/background_*_pool_size: "yes"
422 - profiles/default/max_*_for_server: "yes"
425 - settings/logger: "yes"
426 #################################################
428 ## Access to ClickHouse instances
430 ################################################
432 # Possible values for 'scheme' are:
433 # 1. http - force http to be used to connect to ClickHouse instances
434 # 2. https - force https to be used to connect to ClickHouse instances
435 # 3. auto - either http or https is selected based on open ports
437 # ClickHouse credentials (username, password and port) to be used by the operator to connect to ClickHouse instances.
438 # These credentials are used for:
439 # 1. Metrics requests
440 # 2. Schema maintenance
441 # User with these credentials can be specified in additional ClickHouse .xml config files,
442 # located in 'clickhouse.configuration.file.path.user' folder
446 # Location of the k8s Secret with username and password to be used by the operator to connect to ClickHouse instances.
447 # Can be used instead of explicitly specified username and password available in sections:
448 # - clickhouse.access.username
449 # - clickhouse.access.password
450 # Secret should have two keys:
454 # Empty `namespace` means that k8s secret would be looked in the same namespace where operator's pod is running.
456 # Empty `name` means no k8s Secret would be looked for
457 name: '{{ include "altinity-clickhouse-operator.fullname" . }}'
458 # Port where to connect to ClickHouse instances to
460 # Timeouts used to limit connection and queries from the operator to ClickHouse instances
461 # Specified in seconds.
463 # Timout to setup connection from the operator to ClickHouse instances. In seconds.
465 # Timout to perform SQL query from the operator to ClickHouse instances. In seconds.
467 ################################################
469 ## Addons specifies additional configuration sections
470 ## Should it be called something like "templates"?
472 ################################################
487 ### users.d is global while description depends on CH version which may vary on per-host basis
488 ### In case of global-ness this may be better to implement via auto-templates
490 ### As a solution, this may be applied on the whole cluster based on any of its hosts
492 ### What to do when host is just created? CH version is not known prior to CH started and user config is required before CH started.
493 ### We do not have any info about the cluster on initial creation
496 "{clickhouseOperatorUser}/access_management": 1
497 "{clickhouseOperatorUser}/named_collection_control": 1
498 "{clickhouseOperatorUser}/show_named_collections": 1
499 "{clickhouseOperatorUser}/show_named_collections_secrets": 1
509 clickhouse_operator/format_display_secrets_in_show_and_select: 1
513 ## this may be added on per-host basis into host's conf.d folder
515 display_secrets_in_show_and_select: 1
517 #################################################
519 ## Metrics collection
521 ################################################
523 # Timeouts used to limit connection and queries from the metrics exporter to ClickHouse instances
524 # Specified in seconds.
526 # Timeout used to limit metrics collection request. In seconds.
527 # Upon reaching this timeout metrics collection is aborted and no more metrics are collected in this cycle.
528 # All collected metrics are returned.
530 # Regexp to match tables in system database to fetch metrics from.
531 # Multiple tables can be matched using regexp. Matched tables are merged using merge() table function.
532 # Default is "^(metrics|custom_metrics)$" which fetches from both system.metrics and system.custom_metrics.
533 tablesRegexp: "^(metrics|custom_metrics)$"
534 # List of regexps to match ClickHouse metrics to exclude from export.
535 # Regexps match internal metric names before Prometheus normalization and prefixing.
536 # Default is the per-CPU OS metrics filter shown below; set to [] to disable.
538 - "^metric\\.(OS.*CPU[0-9]+|CPUFrequencyMHz_[0-9]+)$"
541 ################################################
543 ## Configuration files section
545 ################################################
547 # Each 'path' can be either absolute or relative.
548 # In case path is absolute - it is used as is
549 # In case path is relative - it is relative to the folder where configuration file you are reading right now is located.
551 # Path to the folder where Keeper configuration files common for all instances within a CHK are located.
552 common: chk/keeper_config.d
553 # Path to the folder where Keeper configuration files unique for each instance (host) within a CHK are located.
555 # Path to the folder where Keeper configuration files with users' settings are located.
556 # Files are common for all instances within a CHI.
558 ################################################
562 ## Operator-wide security toggles. All fields default to unset / permissive so
563 ## upgrades from earlier versions preserve identical behavior. Set explicit
564 ## values here to tighten the operator's outbound TLS posture; CHIs may further
565 ## override per-cluster via spec.configuration.clusters[].security.
567 ## Three orthogonal axes govern this section:
568 ## 1. security.policy — TLS-hardening master switch (Permissive | Enforced)
569 ## 2. security.fips.enforced — FIPS cryptographic-module gate (bool)
570 ## 3. security.images.policy — Workload image-tag governance (Permissive | FIPSRequired)
571 ## Each axis is independent: enabling one does not enable the others.
573 ## See docs/chi-examples/70-chop-config.yaml for a fully-annotated example
574 ## and docs/security_hardening.md for the design + per-knob semantics.
576 ################################################
580 # Strict | None | "" (preserve legacy InsecureSkipVerify=true)
582 # "1.2" | "1.3" | "" (Go stdlib default)
584 # SNI / cert-name override; default = dial host
586 # Inline PEM CA bundle (or base64-wrapped)
588 # Alternate source — Secret in operator namespace. Mutually exclusive
589 # with the inline rootCA above. Empty `name` = not used (no-op).
590 # When `key` is empty, the operator tries "ca.crt" then "tls.crt".
600 # Strict refuses an insecure kubeconfig at startup
602 # Reserved — not yet enforced on K8s API transport
605 # Plain (default) | Secure (loopback + X-CHOP-Token)
607 # Defaults to 127.0.0.1 when mode=Secure
609 # Defaults to /etc/clickhouse-operator-ipc/token
611 # Operator-wide TLS-hardening master switch. ONLY governs TLS posture across
612 # CH / ZK / K8s transports — NOT the FIPS cryptographic-module gate (see
613 # security.fips.enforced below for that, orthogonal axis).
615 # Permissive (default) preserves 0.27.0 behavior — no coercion, no rejection.
616 # Enforced coerces all TLS knobs above to their Strict positions at startup:
617 # - clickhouse.tls.verify=Strict, clickhouse.tls.minVersion=1.3
618 # - zookeeper.tls.verify=Strict, zookeeper.tls.minVersion=1.3
619 # - kubernetes.tls.verify=Strict, kubernetes.tls.minVersion=1.3
621 # - clickhouse.access.scheme: http is coerced to https
622 # Enforced also rejects CHIs that cannot be served in a hardened posture
623 # (e.g. plaintext external ZooKeeper, ZK digest auth).
625 # Independent of the Go FIPS toolchain — works on non-FIPS builds for pure
626 # TLS hardening. Combine with security.fips.enforced=true for full FIPS
627 # cryptographic-module enforcement.
629 # FIPS cryptographic-module enforcement. Orthogonal to security.policy.
630 # Default operator and metrics-exporter images are FIPS-compatible —
631 # built with GOFIPS140=v1.0.0 and run with GODEBUG=fips140=on, so
632 # crypto/fips140.Enabled() returns true at runtime.
633 # When enforced=true, the operator Fatals at startup unless the binary
634 # reports crypto/fips140 Enabled — guards against accidentally running
635 # a non-FIPS rebuild in a hardened deployment.
639 # Workload image-tag governance gate. Today's only non-default value is
640 # FIPSRequired (admission rejects CRs whose CH/Keeper images lack 'fips'
641 # in tag; post-Ready SELECT version() must contain 'fips' or CR aborts).
642 # Orthogonal to security.policy and security.fips.enforced.
643 # See docs/security_hardening_fips.md → "security.images.policy: FIPSRequired"
644 # for the full policy matrix + detection details + recovery procedure.
646 ################################################
648 ## Template(s) management section
650 ################################################
653 # CHI template updates handling policy
654 # Possible policy values:
655 # - ReadOnStart. Accept CHIT updates on the operator's start only.
656 # - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply new CHITs on next regular reconcile of the CHI
657 policy: ApplyOnNextReconcile
658 # Path to the folder where ClickHouseInstallation templates .yaml manifests are located.
659 # Templates are added to the list of all templates and used when CHI is reconciled.
660 # Templates are applied in sorted alpha-numeric order.
661 path: chi/templates.d
663 # CHK template updates handling policy
664 # Possible policy values:
665 # - ReadOnStart. Accept CHIT updates on the operators start only.
666 # - ApplyOnNextReconcile. Accept CHIT updates at all time. Apply new CHITs on next regular reconcile of the CHI
667 policy: ApplyOnNextReconcile
668 # Path to the folder where ClickHouseInstallation templates .yaml manifests are located.
669 # Templates are added to the list of all templates and used when CHI is reconciled.
670 # Templates are applied in sorted alpha-numeric order.
671 path: chk/templates.d
672 ################################################
676 ################################################
678 # Reconcile runtime settings
680 # Max number of concurrent CHI reconciles in progress
681 reconcileCHIsThreadsNumber: 10
682 # The operator reconciles shards concurrently in each CHI with the following limitations:
683 # 1. Number of shards being reconciled (and thus having hosts down) in each CHI concurrently
684 # can not be greater than 'reconcileShardsThreadsNumber'.
685 # 2. Percentage of shards being reconciled (and thus having hosts down) in each CHI concurrently
686 # can not be greater than 'reconcileShardsMaxConcurrencyPercent'.
687 # 3. The first shard is always reconciled alone. Concurrency starts from the second shard and onward.
688 # Thus limiting number of shards being reconciled (and thus having hosts down) in each CHI by both number and percentage
690 # Max number of concurrent shard reconciles within one cluster in progress
691 reconcileShardsThreadsNumber: 5
692 # Max percentage of concurrent shard reconciles within one cluster in progress
693 reconcileShardsMaxConcurrencyPercent: 50
694 # Reconcile StatefulSet scenario
696 # Create StatefulSet scenario
698 # What to do in case created StatefulSet is not in 'Ready' after `reconcile.statefulSet.update.timeout` seconds
700 # 1. abort - abort the process, do nothing with the problematic StatefulSet, leave it as it is,
701 # do not try to fix or delete or update it, just abort reconcile cycle.
702 # Do not proceed to the next StatefulSet(s) and wait for an admin to assist.
703 # 2. delete - delete newly created problematic StatefulSet and follow 'abort' path afterwards.
704 # 3. ignore - ignore an error, pretend nothing happened, continue reconcile and move on to the next StatefulSet.
706 # Update StatefulSet scenario
708 # How many seconds to wait for created/updated StatefulSet to be 'Ready'
710 # How many seconds to wait between checks/polls for created/updated StatefulSet status
712 # What to do in case updated StatefulSet is not in 'Ready' after `reconcile.statefulSet.update.timeout` seconds
714 # 1. abort - abort the process, do nothing with the problematic StatefulSet, leave it as it is,
715 # do not try to fix or delete or update it, just abort reconcile cycle.
716 # Do not proceed to the next StatefulSet(s) and wait for an admin to assist.
717 # 2. rollback - delete Pod and rollback StatefulSet to previous Generation.
718 # Pod would be recreated by StatefulSet based on rollback-ed StatefulSet configuration.
719 # Follow 'abort' path afterwards.
720 # 3. ignore - ignore an error, pretend nothing happened, continue reconcile and move on to the next StatefulSet.
722 # Recreate StatefulSet scenario
724 # What to do in case operator is in need to recreate StatefulSet?
726 # 1. abort - abort the process, do nothing with the problematic StatefulSet, leave it as it is,
727 # do not try to fix or delete or update it, just abort reconcile cycle.
728 # Do not proceed to the next StatefulSet(s) and wait for an admin to assist.
729 # 2. recreate - proceed and recreate StatefulSet.
731 # Triggered when PVC data loss or missing volumes are detected
733 # Triggered when StatefulSet update fails or StatefulSet is not ready
734 onUpdateFailure: recreate
735 # Reconcile Host scenario
737 # The operator during reconcile procedure should wait for a ClickHouse host to achieve the following conditions:
739 # Whether the operator during reconcile procedure should wait for a ClickHouse host:
740 # - to be excluded from a ClickHouse cluster
741 # - to complete all running queries
742 # - to be included into a ClickHouse cluster
743 # respectfully before moving forward with host reconcile
747 # The operator during reconcile procedure should wait for replicas to catch-up
748 # replication delay a.k.a replication lag for the following replicas
750 # All replicas (new and known earlier) are explicitly requested to wait for replication to catch-up
752 # New replicas only are requested to wait for replication to catch-up
754 # Replication catch-up is considered to be completed as soon as replication delay
755 # a.k.a replication lag - calculated as "MAX(absolute_delay) FROM system.replicas"
756 # is within this specified delay (in seconds)
759 # Whether the operator during host launch procedure should wait for startup probe to succeed.
760 # In case probe is unspecified wait is assumed to be completed successfully.
761 # Default option value is to do not wait.
763 # Whether the operator during host launch procedure should wait for readiness probe to succeed.
764 # In case probe is unspecified wait is assumed to be completed successfully.
765 # Default option value is to wait.
767 # The operator during reconcile procedure should drop the following entities:
770 # Whether the operator during reconcile procedure should drop replicas when replica is deleted
772 # Whether the operator during reconcile procedure should drop replicas when replica volume is lost
774 # Whether the operator during reconcile procedure should drop active replicas when replica is deleted or recreated
776 ################################################
778 ## Coordination with external systems during reconcile
780 ################################################
783 # How long the operator waits for a referenced ClickHouseKeeper to become ready
784 # before aborting CHI reconcile. In seconds.
786 # Reaction when a referenced CHK resource changes:
787 # none — do nothing (default, backward-compatible)
788 # reconcile — trigger CHI reconcile
789 # onKeeperResourceUpdate: none
790 ################################################
792 ## Auto-recovery from aborted reconcile
794 ################################################
796 # Recovery scopes keyed by CHI state being recovered from.
797 # Each scope contains on<Event>: <action> mappings that apply while the CHI
798 # is in that state. Multi-scope design anticipates future states beyond Aborted
799 # (e.g. Failed, Broken).
801 # Recovery from Status=Aborted
803 # Action when a pod belonging to an Aborted CHI transitions to Ready:
804 # retry (default) — re-enqueue the CHI for reconcile
805 # none — do nothing, CHI stays Aborted
807 # Future events (not yet implemented):
808 # onKeeperReady: retry — retry when a referenced CHK becomes ready
809 # onOperatorRestart: retry — sweep Aborted CHIs on operator startup
810 # Future scopes (not yet implemented):
815 # Future global policy knobs (not yet implemented) — flat peers of `from`,
816 # apply across all recovery scopes:
818 # Global kill-switch for auto-recovery:
821 # Cap on consecutive auto-recovery attempts before giving up:
824 # Minimum time between auto-recovery attempts for the same CHI:
827 # Exponential backoff for auto-recovery attempts:
832 ################################################
834 ## Annotations management section
836 ################################################
839 # 1. Propagating annotations from the CHI's `metadata.annotations` to child objects' `metadata.annotations`,
840 # 2. Propagating annotations from the CHI Template's `metadata.annotations` to CHI's `metadata.annotations`,
841 # Include annotations from the following list:
842 # Applied only when not empty. Empty list means "include all, no selection"
844 # Exclude annotations from the following list:
846 ################################################
848 ## Labels management section
850 ################################################
853 # 1. Propagating labels from the CHI's `metadata.labels` to child objects' `metadata.labels`,
854 # 2. Propagating labels from the CHI Template's `metadata.labels` to CHI's `metadata.labels`,
855 # Include labels from the following list:
856 # Applied only when not empty. Empty list means "include all, no selection"
858 # Exclude labels from the following list:
859 # Applied only when not empty. Empty list means "nothing to exclude, no selection"
861 # Whether to append *Scope* labels to StatefulSet and Pod.
862 # Full list of available *scope* labels check in 'labeler.go'
863 # LabelShardScopeIndex
864 # LabelReplicaScopeIndex
866 # LabelCHIScopeCycleSize
867 # LabelCHIScopeCycleIndex
868 # LabelCHIScopeCycleOffset
869 # LabelClusterScopeIndex
870 # LabelClusterScopeCycleSize
871 # LabelClusterScopeCycleIndex
872 # LabelClusterScopeCycleOffset
874 ################################################
876 ## Metrics management section
878 ################################################
882 ################################################
884 ## Status management section
886 ################################################
893 ################################################
895 ## StatefulSet management section
897 ################################################
899 revisionHistoryLimit: 0
900 ################################################
902 ## Pod management section
904 ################################################
906 # Grace period for Pod termination.
907 # How many seconds to wait between sending
908 # SIGTERM and SIGKILL during Pod termination process.
909 # Increase this number is case of slow shutdown.
910 terminationGracePeriod: 30
911 ################################################
913 ## Log parameters section
915 ################################################
918 alsologtostderr: "false"
924 001-templates.json.example: |
926 "apiVersion": "clickhouse.altinity.com/v1",
927 "kind": "ClickHouseInstallationTemplate",
929 "name": "01-default-volumeclaimtemplate"
933 "volumeClaimTemplates": [
935 "name": "chi-default-volume-claim-template",
950 "name": "chi-default-oneperhost-pod-template",
951 "distribution": "OnePerHost",
955 "name": "clickhouse",
956 "image": "clickhouse/clickhouse-server:23.8",
960 "containerPort": 8123
964 "containerPort": 9000
967 "name": "interserver",
968 "containerPort": 9009
979 default-pod-template.yaml.example: |
980 apiVersion: "clickhouse.altinity.com/v1"
981 kind: "ClickHouseInstallationTemplate"
983 name: "default-oneperhost-pod-template"
987 - name: default-oneperhost-pod-template
988 distribution: "OnePerHost"
989 default-storage-template.yaml.example: |
990 apiVersion: "clickhouse.altinity.com/v1"
991 kind: "ClickHouseInstallationTemplate"
993 name: "default-storage-template-2Gi"
996 volumeClaimTemplates:
997 - name: default-storage-template-2Gi
1005 Templates in this folder are packaged with an operator and available via 'useTemplate'
1007 01-clickhouse-operator-profile.xml: |
1009 <!-- This file is auto-generated -->
1010 <!-- Do not edit this file - all changes would be lost -->
1011 <!-- Edit appropriate template in the following folder: -->
1012 <!-- deploy/builder/templates-config -->
1016 # Template parameters available:
1020 <!-- clickhouse-operator user is generated by the operator based on config.yaml in runtime -->
1022 <clickhouse_operator>
1023 <log_queries>0</log_queries>
1024 <skip_unavailable_shards>1</skip_unavailable_shards>
1025 <http_connection_timeout>10</http_connection_timeout>
1026 <max_concurrent_queries_for_all_users>0</max_concurrent_queries_for_all_users>
1027 <os_thread_priority>0</os_thread_priority>
1028 </clickhouse_operator>
1031 02-clickhouse-default-profile.xml: |-
1033 <!-- This file is auto-generated -->
1034 <!-- Do not edit this file - all changes would be lost -->
1035 <!-- Edit appropriate template in the following folder: -->
1036 <!-- deploy/builder/templates-config -->
1041 <os_thread_priority>2</os_thread_priority>
1042 <log_queries>1</log_queries>
1043 <connect_timeout_with_failover_ms>1000</connect_timeout_with_failover_ms>
1044 <distributed_aggregation_memory_efficient>1</distributed_aggregation_memory_efficient>
1045 <parallel_view_processing>1</parallel_view_processing>
1046 <do_not_merge_across_partitions_select_final>1</do_not_merge_across_partitions_select_final>
1047 <load_balancing>nearest_hostname</load_balancing>
1048 <prefer_localhost_replica>0</prefer_localhost_replica>
1049 <!-- materialize_ttl_recalculate_only>1</materialize_ttl_recalculate_only> 21.10 and above -->
1053 keeperConfdFiles: null
1055 01-keeper-01-default-config.xml: |
1057 <!-- This file is auto-generated -->
1058 <!-- Do not edit this file - all changes would be lost -->
1059 <!-- Edit appropriate template in the following folder: -->
1060 <!-- deploy/builder/templates-config -->
1063 <asynchronous_metrics_keeper_metrics_only>1</asynchronous_metrics_keeper_metrics_only>
1065 <coordination_settings>
1066 <async_replication>1</async_replication>
1067 <min_session_timeout_ms>10000</min_session_timeout_ms>
1068 <operation_timeout_ms>10000</operation_timeout_ms>
1069 <raft_logs_level>information</raft_logs_level>
1070 <session_timeout_ms>100000</session_timeout_ms>
1071 <use_xid_64>1</use_xid_64>
1072 </coordination_settings>
1073 <hostname_checks_enabled>true</hostname_checks_enabled>
1074 <log_storage_path>/var/lib/clickhouse-keeper/coordination/logs</log_storage_path>
1075 <snapshot_storage_path>/var/lib/clickhouse-keeper/coordination/snapshots</snapshot_storage_path>
1076 <storage_path>/var/lib/clickhouse-keeper</storage_path>
1077 <tcp_port>2181</tcp_port>
1079 Four-letter-word command allowlist.
1081 Set explicitly to the upstream-default list so the operator-rendered
1082 liveness probe (which sends `ruok` over TCP and expects `imok`) keeps
1083 working even if a user adds their own keeper_server settings.
1085 Without this, a user override that restricts the allowlist
1086 (e.g. `four_letter_word_white_list: "mntr,stat"` for security)
1087 would silently disable `ruok` → liveness probe always fails → CrashLoopBackOff.
1089 The list mirrors ClickHouse Keeper's compiled-in default; users who want a
1090 stricter list can override this value, but they must keep `ruok` if they
1091 also use the default operator probes.
1093 <four_letter_word_white_list>conf,cons,crst,envi,ruok,srst,srvr,stat,wchs,dirs,mntr,isro</four_letter_word_white_list>
1095 <listen_host>::</listen_host>
1096 <listen_host>0.0.0.0</listen_host>
1097 <listen_try>1</listen_try>
1099 <console>1</console>
1100 <level>information</level>
1102 <max_connections>4096</max_connections>
1104 01-keeper-02-readiness.xml: |
1106 <!-- This file is auto-generated -->
1107 <!-- Do not edit this file - all changes would be lost -->
1108 <!-- Edit appropriate template in the following folder: -->
1109 <!-- deploy/builder/templates-config -->
1116 <endpoint>/ready</endpoint>
1121 01-keeper-03-enable-reconfig.xml: |-
1123 <!-- This file is auto-generated -->
1124 <!-- Do not edit this file - all changes would be lost -->
1125 <!-- Edit appropriate template in the following folder: -->
1126 <!-- deploy/builder/templates-config -->
1130 <enable_reconfiguration>false</enable_reconfiguration>
1133 keeperTemplatesdFiles:
1135 Templates in this folder are packaged with an operator and available via 'useTemplate'
1136 keeperUsersdFiles: null
1137# additionalResources -- list of additional resources to create (processed via `tpl` function),
1138# useful for create ClickHouse clusters together with clickhouse-operator.
1139# check `kubectl explain chi` for details
1140additionalResources: []
1145# name: {{ include "altinity-clickhouse-operator.fullname" . }}-cm
1146# namespace: {{ include "altinity-clickhouse-operator.namespace" . }}
1151# name: {{ include "altinity-clickhouse-operator.fullname" . }}-s
1152# namespace: {{ include "altinity-clickhouse-operator.namespace" . }}
1156# apiVersion: clickhouse.altinity.com/v1
1157# kind: ClickHouseInstallation
1159# name: {{ include "altinity-clickhouse-operator.fullname" . }}-chi
1160# namespace: {{ include "altinity-clickhouse-operator.namespace" . }}
1169 # dashboards.enabled -- provision grafana dashboards as configMaps (can be synced by grafana dashboards sidecar https://github.com/grafana/helm-charts/blob/grafana-8.3.4/charts/grafana/values.yaml#L778 )
1171 # dashboards.additionalLabels -- labels to add to a secret with dashboards
1173 # dashboards.additionalLabels.grafana_dashboard - will watch when official grafana helm chart sidecar.dashboards.enabled=true
1174 grafana_dashboard: ""
1175 # dashboards.annotations -- annotations to add to a secret with dashboards
1177 # dashboards.annotations.grafana_folder -- folder where will place dashboards, requires define values in official grafana helm chart sidecar.dashboards.folderAnnotation: grafana_folder
1178 grafana_folder: clickhouse-operator