Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set dynamic parameter to .spec.configuration.files #1318

Open
zouwenjie00 opened this issue Jan 29, 2024 · 4 comments
Open

How to set dynamic parameter to .spec.configuration.files #1318

zouwenjie00 opened this issue Jan 29, 2024 · 4 comments

Comments

@zouwenjie00
Copy link

zouwenjie00 commented Jan 29, 2024

HI:
I want to create custom macros ,like this:

   configuration:
    files:
      conf.d/customer_marco.xml: |
       <yandex>
         <macros>
           <installation2>{chi}</installation2>
           <cluster>demo</cluster>
           <shard>{shard}</shard>
           <replica>{replica}-{shard}</replica>
         </macros>
       </yandex>

and want get shardname 、replicaname、podname to set its,but it is not effect

@Slach
Copy link
Collaborator

Slach commented Jan 29, 2024

what is the goal?

clickhouse-operator already generate some macros values during runtime, like {cluster} {shard} {replica}

why do you need to define other macros? which is your use case?

@zouwenjie00
Copy link
Author

what is the goal?

clickhouse-operator already generate some macros values during runtime, like {cluster} {shard} {replica}

why do you need to define other macros? which is your use case?

I want to transfer the ck cluster on Independent deployment server to k8s ck cluster,this cluster have different macros , and different database table have different macros , i do not want change the sql

@Slach
Copy link
Collaborator

Slach commented Jan 31, 2024

Is your indepentent deployment server just single instance of clickhouse-server?
Is this kubernetes cluster or single docker container or standalone systemd service?

@alex-zaitsev
Copy link
Member

Hi @zouwenjie00 , have you checked system.macros table? By default, operator already generates macros similarly to what you want, populating it with proper values for every node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants