clickhouse

by serge.logvinov

Helm chartv0.22.5App 26.10.5Verified publisher

Clickhouse chart for Kubernetes

About this chart

clickhouse

Clickhouse chart for Kubernetes

Clickhouse is a fast open-source OLAP database management system.

Supports both Altinity and standalone (statefulset) installations. Supports backup to the external storage, using clickhouse-backup Periodically checks backups by schedule.

Homepage: https://github.com/sergelogvinov/helm-charts

Maintainers

NameEmailUrl
sergelogvinovhttps://github.com/sergelogvinov

Source Code

Example:

# clickhouse.yaml

installationType: "standalone" # or "altinity"

clickhouse:
  users:
    - name: reader
      profile: reader
      quota: default
      # echo -n "reader" | shasum -a 256
      password: 3d0941964aa3ebdcb00ccef58b1bb399f9f898465e9886d5aec7f31090a0fb30

ingress:
  enabled: true
  hosts:
    - host: clickhouse.example.com
  tls:
    - secretName: clickhouse.example.com-tls
      hosts:
        - clickhouse.example.com

resources:
  limits:
    cpu: 2
    memory: 4Gi
  requests:
    cpu: 200m
    memory: 1Gi

persistence:
  enabled: true
  size: 10Gi

backup:
  enabled: true

  args:
    - create_remote
    - --schema

  envs:
    REMOTE_STORAGE: s3
  config:
    s3:
      bucket: bucket-name
      path: clickhouse-backup
      storage_class: STANDARD
      endpoint: s3.amazonaws.com
      region: us-east-1
      concurrency: 2
      compression_level: 4
      compression_format: brotli

backupCheck:
  enabled: true

metrics:
  enabled: true

Values

KeyTypeDefaultDescription
replicaCountint1
image.repositorystring"clickhouse/clickhouse-server"
image.pullPolicystring"IfNotPresent"
image.tagstring""
imagePullSecretslist[]
nameOverridestring""
fullnameOverridestring""
installationTypestring"standalone"Installation type can be "altinity" or "standalone"
clusterDomainstring"cluster.local"Cluster domain refs: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
serviceAccountobject{"annotations":{},"create":true,"name":""}Pods Service Account. ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
podlabelsobject{}Extra labels for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podAnnotationsobject{}Annotations for pod. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podSecurityContextobject{"fsGroup":101,"fsGroupChangePolicy":"OnRootMismatch","runAsGroup":101,"runAsNonRoot":true,"runAsUser":101}Pod Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":false,"seccompProfile":{"type":"RuntimeDefault"}}Container Security Context. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
serviceobject{"ipFamilies":["IPv4"],"type":"ClusterIP"}Service parameters ref: https://kubernetes.io/docs/user-guide/services/
ingressobject{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"chart-example.local","paths":["/clickhouse"]}],"tls":[]}Clickhouse ingress parameters ref: http://kubernetes.io/docs/user-guide/ingress/
autoscalingobject{"controlledResources":["cpu","memory"],"controlledValues":"RequestsOnly","enabled":false,"maxAllowed":{},"minAllowed":{},"updatePolicy":{"updateMode":"InPlaceOrRecreate"}}Vertical pod autoscaler
autoscaling.controlledResourceslist["cpu","memory"]Resource to control Possible values are "cpu" and "memory"
autoscaling.controlledValuesstring"RequestsOnly"Controls which resource value should be autoscaled Possible values are "RequestsAndLimits" and "RequestsOnly"
autoscaling.maxAllowedobject{}Max allowed resources for the pod default is resources.limits
autoscaling.minAllowedobject{}Min allowed resources for the pod default is resources.requests
autoscaling.updatePolicyobject{"updateMode":"InPlaceOrRecreate"}Update policy Possible values are "Off", "Initial", "Recreate", "InPlaceOrRecreate" and "Auto"
resourcesobject{"requests":{"cpu":"500m","memory":"512Mi"}}Resource requests and limits. ref: https://kubernetes.io/docs/user-guide/compute-resources/
extraVolumeslist[]Additional volume mounts.
extraVolumeMountslist[]Additional volumes.
extraInitContainersobject{}Additional init containers.
extraContainersobject{}Additional containers.
persistenceobject{"accessModes":["ReadWriteOnce"],"annotations":{},"enabled":true,"size":"64Gi"}Persistence parameters ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
priorityClassNamestring""Priority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
updateStrategyobject{"type":"RollingUpdate"}pod deployment update strategy type. ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment
nodeSelectorobject{}Node labels for pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/
tolerationslist[]Tolerations for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
affinityobject{}Affinity for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
clickhouseKeeper.enabledboolfalse
clickhouseKeeper.replicaCountint3
clickhouseKeeper.image.repositorystring"clickhouse/clickhouse-keeper"
clickhouseKeeper.image.pullPolicystring"IfNotPresent"
clickhouseKeeper.image.tagstring""
clickhouseKeeper.resources.limits.cpustring"500m"
clickhouseKeeper.resources.limits.memorystring"512Mi"
clickhouseKeeper.resources.requests.cpustring"100m"
clickhouseKeeper.resources.requests.memorystring"128Mi"
clickhouseKeeper.persistenceobject{"accessModes":["ReadWriteOnce"],"annotations":{},"enabled":true,"size":"5Gi"}Persistence parameters ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
clickhouseKeeper.priorityClassNamestringnilPriority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
clickhouseKeeper.nodeSelectorobject{}Node labels for pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/
clickhouseKeeper.tolerationslist[]Tolerations for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
clickhouseKeeper.podAntiAffinityPresetstring"hard"Pod Anti Affinity soft/hard
clickhouseKeeper.podAntiAffinityPresetKeystring"kubernetes.io/hostname"
clickhouseKeeper.affinityobject{}Affinity for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
backup.enabledboolfalse
backup.image.repositorystring"altinity/clickhouse-backup"
backup.image.pullPolicystring"IfNotPresent"
backup.image.tagstring"2.8.3"
backup.schedulestring"15 4 * * *"
backup.argslist[]
backup.envsobject{}
backup.configobject{}
backup.resourcesobject{"limits":{"cpu":4,"memory":"512Mi"},"requests":{"cpu":"500m","memory":"256Mi"}}Resource requests and limits. ref: https://kubernetes.io/docs/user-guide/compute-resources/
backup.priorityClassNamestringnilPriority Class Name ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
backupCheck.enabledboolfalse
backupCheck.schedulestring"15 8 * * *"
backupCheck.envsobject{}
backupCheck.resourcesobject{"limits":{"cpu":1,"memory":"4Gi"},"requests":{"cpu":"100m","memory":"512Mi"}}Resource requests and limits. ref: https://kubernetes.io/docs/user-guide/compute-resources/
backupCheck.persistenceobject{"accessModes":["ReadWriteOnce"],"annotations":{},"size":"8Gi"}Persistence parameters ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
backupCheck.nodeSelectorobject{}Node labels for pod assignment. ref: https://kubernetes.io/docs/user-guide/node-selection/
backupCheck.tolerationslist[]Tolerations for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
backupCheck.affinityobject{}Affinity for pod assignment. ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
cronjobsobject{}
tlsCerts.createboolfalse
metrics.enabledboolfalse
storageobject{}
clickhouse.namestring""Clickhouse cluster name Use helm-chart name if empty
clickhouse.logLevelstring"information"Clickhouse log level ref: https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#logger trace, debug, information, warning, error
clickhouse.accessManagementboolfalseClickhouse SQL-driven Access Control refs: https://clickhouse.com/docs/en/operations/access-rights
clickhouse.users[0]object{"name":"logger","password":"2686af9f25e1a64f5e9f7290c7e457aa06b616fb31d2b4331ff6fa0857661cd5","profile":"default","quota":"default"}Clickhouse read write user
clickhouse.users[1]object{"accessManagement":false,"name":"reader","password":"3d0941964aa3ebdcb00ccef58b1bb399f9f898465e9886d5aec7f31090a0fb30","profile":"reader","quota":"default"}Clickhouse read only user
clickhouse.zookeeperobject{}
clickhouse.collectionslist[]Clickhouse named collections
clickhouse.envsobject{}
clickhouse.envValueFromobject{}Clickhouse environment variable references that will be added
clickhouse.customConfigobject{}
clickhouse.customUsersConfigobject{}Clickhouse custom user-level config files mounted into /etc/clickhouse-server/users.d/. Use this for settings that belong to a profile/user (e.g. async_insert_busy_timeout_ms, max_memory_usage), which customConfig (mounted into config.d/) cannot override. Each key becomes a file in users.d/. Keys must not collide with customConfig keys.
clickhouse.initDBobject{}Clickhouse initdb scripts

Deploy clickhouse with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has clickhouse on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartclickhouse is pinned at v0.22.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply