Altinity / clickhouse-operator

Altinity Kubernetes Operator for ClickHouse creates, configures and manages ClickHouse® clusters running on Kubernetes
https://altinity.com
Apache License 2.0
1.88k stars 460 forks source link

How clickhouse-operator we can use? #914

Closed susa0421 closed 2 years ago

susa0421 commented 2 years ago

Hi,

I would like to understand clickhouse-operator installation or how to integrate this with clickhouse backup , Need guidance to use clickhouse-operator

Slach commented 2 years ago

Did you look https://github.com/Altinity/clickhouse-backup/blob/master/Examples.md#how-to-use-clickhouse-backup-in-kubernetes ?

utsavll0 commented 2 years ago

Hi @Slach, actually I had a similar question.

I had an already existing deployment of clickhouse for posthog (our analytics tool). And we wanted to add backup functionality to it. So I created a new yaml file with the values you have linked and used kubectl apply -f to apply it to the cluster

It created two new pods prefixed with chi-bakup-

If I connect to the container clickhouse-backup inside it I am not able to list the tables of my clickhouse table. What I suspect is that I it is connecting to the other container called clickhouse-pod in the same chi-backup pod.

How do I make the clickhouse-backup container use my correct clickhouse-operator for backup?

Slach commented 2 years ago

@utsavll0 you should not just blind apply new manifests, which provided on https://github.com/Altinity/clickhouse-backup/blob/master/Examples.md#how-to-use-clickhouse-backup-in-kubernetes

instead of it, you should modify your exists manifest to modify potTemplates in posthost kind: ClickHouseInstallation to add clickhouse-backup container

if you install your clickhouse via posthog helm chart, could ask in posthost github, how to modify podTemplate in their helm chart via values