clickhouse-operator icon indicating copy to clipboard operation
clickhouse-operator copied to clipboard

Helm chart

Open ganievs opened this issue 3 years ago • 7 comments

HI guys! The issue is created in continue to PR #836 I've tested it in some basic configuration with replicated and sharded installation of clickhouse.

ganievs avatar Dec 20 '21 13:12 ganievs

I would love an official helm chart, currently I'm using slamdevs chart, which is fine, but it doesn't seem maintained anymore and is starting to lag in versions

esselius avatar Feb 04 '22 09:02 esselius

@esselius look to https://github.com/Altinity/clickhouse-operator/pull/836#issuecomment-998097594 to be maintainable helm chart should be generated from current https://github.com/Altinity/clickhouse-operator/blob/master/deploy/operator/clickhouse-operator-install-bundle.yaml, if you familiar with https://github.com/mikefarah/yq/ and https://github.com/arttor/helmify feel free to make pull request

Slach avatar Feb 04 '22 09:02 Slach

@Slach helmify simply puts lots of things inside variable, it will be really hard to use this chart :( for instance, variable "defaultPodTemplateYamlExample":

` defaultPodTemplateYamlExample: |

apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallationTemplate"
metadata:
  name: "default-oneperhost-pod-template"
spec:
  templates:
    podTemplates: 
      - name: default-oneperhost-pod-template
        distribution: "OnePerHost"

` so it gives some possibility to override something but I think, this is error prone concept of using helm chart. Do you use script for generating "clickhouse-operator-install-bundle.yaml" ?

navi86 avatar Apr 02 '22 12:04 navi86

Do you use script for generating "clickhouse-operator-install-bundle.yaml" ?

Yes look to https://github.com/Altinity/clickhouse-operator/tree/0.18.2/deploy/builder/

Slach avatar Apr 02 '22 16:04 Slach

Hey guys! I have task to deploy clickhouse cluster with integrated clickhouse-backup and I'm writing chart for this and will like to share it. As I understand, problem is you want chart to be generated from some kind of templates, where can I look at your standard process, maybe I can help?

Bluesboy avatar Apr 09 '22 01:04 Bluesboy

@Bluesboy look to Yes look to https://github.com/Altinity/clickhouse-operator/tree/0.18.2/deploy/builder/ try to understand how it works to generate bundle.yaml try to make script which got temaplates and created two separate charts first install crds + clickhouse-operator second for install kind: ClickHouseInstallation wich requireme first chart

Slach avatar Apr 09 '22 02:04 Slach

Hi all! Sorry for delay, I've opened a new draft PR #925 with chart generation. First of all I faced with a problem. I've error when I run helm lint. [ERROR] templates/: parse error at (clickhouse-operator/templates/etc-clickhouse-operator-usersd-files.yaml:10): ".01C" Helm can't parse the values what starting with number, like .Values.etcClickhouseOperatorUsersdFiles.02ClickhouseDefaultProfileXml Do you have any ideas how to solve that?

ganievs avatar May 06 '22 14:05 ganievs

@ganievs If you're still stuck on this, I think I was able to work around the problem by renaming the files the variables are named after. Note that I have only tested this in a sandbox environment and not production, but it seems to work the same.

Here's a quick and dirty script to do the necessary renames, put it in deploy/helm:

#!/bin/bash

mv ../builder/templates-config/config.d/01-clickhouse-01-listen.xml ../builder/templates-config/config.d/a-clickhouse-01-listen.xml
mv ../builder/templates-config/config.d/01-clickhouse-02-logger.xml ../builder/templates-config/config.d/b-clickhouse-02-logger.xml
mv ../builder/templates-config/config.d/01-clickhouse-03-query_log.xml ../builder/templates-config/config.d/c-clickhouse-03-query_log.xml
mv ../builder/templates-config/config.d/01-clickhouse-04-part_log.xml ../builder/templates-config/config.d/d-clickhouse-04-part_log.xml

mv ../builder/templates-config/templates.d/001-templates.json.example ../builder/templates-config/templates.d/a-templates.json.example

mv ../builder/templates-config/users.d/01-clickhouse-user.xml ../builder/templates-config/users.d/a-clickhouse-user.xml
mv ../builder/templates-config/users.d/02-clickhouse-default-profile.xml ../builder/templates-config/users.d/b-clickhouse-default-profile.xml
mv ../builder/templates-config/users.d/03-database-ordinary.xml ../builder/templates-config/users.d/c-database-ordinary.xml

I'm sure this script could be improved so it doesn't need to be updated if more files are added. Remember to rebuild the operator files by running deploy/builder/build-clickhouse-operator-configs.sh and deploy/builder/build-clickhouse-operator-install-yaml.sh afterward.

spectrogram avatar Oct 20 '22 03:10 spectrogram

Helm chart is available

alex-zaitsev avatar Feb 14 '24 16:02 alex-zaitsev