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

Support ClickHouse Cluster deployment #55

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

yanjunz97
Copy link
Contributor

Fix #53

This PR adds support for ClickHouse cluster deployment with shards and replicas.

Signed-off-by: Yanjun Zhou zhouya@vmware.com

@yanjunz97 yanjunz97 added this to the 0.2 milestone Jun 21, 2022
@yuntanghsu
Copy link
Contributor

Do we need to add podDistribution for clickhouse pod? Like ClickHouseAntiAffinity/ShardAntiAffinity/ReplicaAntiAffinity?

@yanjunz97
Copy link
Contributor Author

Do we need to add podDistribution for clickhouse pod? Like ClickHouseAntiAffinity/ShardAntiAffinity/ReplicaAntiAffinity?

Thanks Yun-Tang for the suggestion! Add a default podDistribution of type MaxNumberPerNode and allows to be changed in values.yaml.

docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
build/charts/theia/README.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
3 replicas will be deployed for ClickHouse cluster. Please make sure there are
at least 3 nodes available in your Kubernetes cluster. To use a customized
ZooKeeper cluster, please refer the
[ClickHouse instructions](https://github.com/Altinity/clickhouse-operator/blob/master/docs/zookeeper_setup.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the name of the link ClickHouse instructions can be more descriptive/specific, same for L245

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense! I update it to ZooKeeper setup instructions for ClickHouse. Please tell me if you have other suggestion, thanks!

docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
build/charts/theia/values.yaml Show resolved Hide resolved
@yuntanghsu
Copy link
Contributor

LGTM

build/charts/theia/README.md Outdated Show resolved Hide resolved
build/charts/theia/README.md Outdated Show resolved Hide resolved
build/charts/theia/README.md Outdated Show resolved Hide resolved
build/charts/theia/values.yaml Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
@yanjunz97 yanjunz97 force-pushed the clickhouse-cluster branch 4 times, most recently from 31d50b1 to 851b558 Compare July 21, 2022 23:47
Copy link
Contributor

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have much to add in terms of comments, as the change LGTM.
We need to finalize on our strategy regarding support for non-clustered Clickhouse and then we can finalize this PR.

@@ -18,6 +18,14 @@ Kubernetes: `>= 1.16.0-0`

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| clickhouse.cluster.enable | bool | `false` | Determine whether to deploy ClickHouse as a cluster. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we discuss on whether we consider non-clustered supported, do you think we can enable clustering by default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we plan to deprecate the non-clustered, I think it might be good to remove cluster.enable here and always deploy ClickHouse cluster. Updated as this way.

| clickhouse.storage.createPersistentVolume.local.path | string | `"/data"` | The local path. Required when type is "Local". |
| clickhouse.storage.createPersistentVolume.nfs.host | string | `""` | The NFS server hostname or IP address. Required when type is "NFS". |
| clickhouse.storage.createPersistentVolume.nfs.path | string | `""` | The path exported on the NFS server. Required when type is "NFS". |
| clickhouse.storage.createPersistentVolume.nfs.hosts | list | `[]` | A list of NFS server hostname or IP address. Required when type is "NFS". When ClickHouse clustering is enabled, please provide (shards * replicas) NFS servers. Otherwise, only one NFS server is required. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're not providing NFS servers but NFS shares, is that correct? They could be for instance all on the same server, mapped to locations assigned to different physical drives.

Copy link
Contributor Author

@yanjunz97 yanjunz97 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An NFS share could be defined as nfs.hosts:nfs.path. Do you think this is better to let user input a list of nfs.hosts:nfs.path instead of accepting the two values separately, so that user can use either multiple servers or single server with multiple drives?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as above, thanks

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@4b15e06). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #55   +/-   ##
=======================================
  Coverage        ?   24.72%           
=======================================
  Files           ?        9           
  Lines           ?     1278           
  Branches        ?        0           
=======================================
  Hits            ?      316           
  Misses          ?      940           
  Partials        ?       22           
Flag Coverage Δ
unit-tests 24.72% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b15e06...f5fe273. Read the comment docs.

@yanjunz97 yanjunz97 force-pushed the clickhouse-cluster branch 2 times, most recently from e35793c to f5fe273 Compare July 30, 2022 00:24
@@ -18,6 +18,14 @@ Kubernetes: `>= 1.16.0-0`

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| clickhouse.cluster.enable | bool | `false` | Determine whether to deploy ClickHouse as a cluster. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

To deploy ClickHouse as a cluster, please set `clickhouse.cluster.enable` to true
and set `clickhouse.cluster.shards` and `clickhouse.cluster.replicas` per your
requirement. Please notice that a standlone ClickHouse server cannot switch to
ClickHouse cluster without deleting. If you plan to scale the ClickHouse cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention that it also will lose data if user wants to switch a cluster to a standalone one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense. Added, thanks!

can deploy multiple replicas in a shard to ensure reliability.

To deploy ClickHouse as a cluster, please set `clickhouse.cluster.enable` to true
and set `clickhouse.cluster.shards` and `clickhouse.cluster.replicas` per your
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just mainly explained what was shard, but replica is a new term now. Not sure if it is easy for users to understand the relationships between shard and replica.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some explanations for replicas. Could you check if it is clearer now? Thank!

@yanjunz97 yanjunz97 mentioned this pull request Aug 1, 2022
@yanjunz97 yanjunz97 force-pushed the clickhouse-cluster branch 2 times, most recently from 14d8a55 to 7c207a6 Compare August 3, 2022 01:39
@yanjunz97
Copy link
Contributor Author

/theia-test-e2e

@yanjunz97
Copy link
Contributor Author

/theia-test-e2e

@yanjunz97
Copy link
Contributor Author

/theia-test-e2e

@yanjunz97
Copy link
Contributor Author

@salv-orlando @ziyouw I have deprecated the non-cluster mode in this PR and verify the e2e tests. Would you like to take another look at this PR?

Copy link
Contributor

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, I just have some comments about documentation

docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
@yanjunz97 yanjunz97 force-pushed the clickhouse-cluster branch 4 times, most recently from 7ae45b7 to 323529c Compare August 5, 2022 22:41
@yanjunz97
Copy link
Contributor Author

/theia-test-e2e

build/charts/theia/README.md Outdated Show resolved Hide resolved
docs/network-flow-visibility.md Outdated Show resolved Hide resolved
Signed-off-by: Yanjun Zhou <zhouya@vmware.com>
Copy link
Contributor

@heanlan heanlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@yuntanghsu yuntanghsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yanjunz97 yanjunz97 merged commit 13d92c9 into antrea-io:main Aug 9, 2022
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

Successfully merging this pull request may close these issues.

Support ClickHouse cluster deployment
8 participants