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 459 forks source link

Support for ttl, row policies and etc propagation when cluster scale up #975

Open kingboung opened 2 years ago

kingboung commented 2 years ago

Context

When cluster scale up, operator only helps to create database and tables.

Desired behavior

Also help propagate ttl, row policies and others necessarry. If not, I need to do it manually however I always forget it

UnamedRus commented 2 years ago

For row policies, i think it's better to look into user storage in ZooKeeper.

https://kb.altinity.com/altinity-kb-integrations/altinity-cloud/altinity-cloud-access-management/

<yandex>
  <user_directories replace="replace">
    <users_xml>
      <path>/etc/clickhouse-server/users.xml</path>
    </users_xml>
    <replicated>
      <zookeeper_path>/clickhouse/access/</zookeeper_path>
    </replicated>
  </user_directories>
</yandex>
kingboung commented 2 years ago

For row policies, i think it's better to look into user storage in ZooKeeper.

https://kb.altinity.com/altinity-kb-integrations/altinity-cloud/altinity-cloud-access-management/

<yandex>
  <user_directories replace="replace">
    <users_xml>
      <path>/etc/clickhouse-server/users.xml</path>
    </users_xml>
    <replicated>
      <zookeeper_path>/clickhouse/access/</zookeeper_path>
    </replicated>
  </user_directories>
</yandex>

The operator's account has already set access_management=1

kingboung commented 2 years ago

How can I do this? Or it will be new requirement?

Slach commented 2 years ago

@kingboung you should create kind: ClickHouseInstallation custom resource and look to kubectl explain chi and kubectl explain chi.spec for details about how to define spec.configuration.files