Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit 73dcc2a

Browse files
committed
docs*: merge the review opinions
1 parent 7faca4c commit 73dcc2a

4 files changed

+122
-88
lines changed

document/deploy_radondb-clickhouse_operator_on_kubernetes.md

Lines changed: 61 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,72 @@ This tutorial demonstrates how to deploy RadonDB ClickHouse on Kubernetes.
3232

3333
### Step 1 : Add Helm Repository
3434

35-
Add and update helm repositor.
35+
Add and update helm repository.
3636

3737
```bash
38+
$ helm repo add <repoName> https://radondb.github.io/radondb-clickhouse-kubernetes/
39+
$ helm repo update
40+
```
41+
42+
**Expected output:**
43+
44+
```shell
3845
$ helm repo add ck https://radondb.github.io/radondb-clickhouse-kubernetes/
46+
"ck" has been added to your repositories
47+
3948
$ helm repo update
49+
Hang tight while we grab the latest from your chart repositories...
50+
...Successfully got an update from the "ck" chart repository
51+
Update Complete. ⎈Happy Helming!
52+
4053
```
4154
4255
### Step 2 : Install RadonDB ClickHouse Operator
4356
4457
```bash
45-
$ helm install clickhouse-operator ck/clickhouse-operator
58+
$ helm install --generate-name -n <Namespace> <repoName>/<appName>
4659
```
4760
61+
**Expected output:**
62+
63+
```shell
64+
$ helm install clickhouse-operator ck/clickhouse-operator -n kube-system
65+
NAME: clickhouse-operator
66+
LAST DEPLOYED: Wed Aug 17 14:43:44 2021
67+
NAMESPACE: kube-system
68+
STATUS: deployed
69+
REVISION: 1
70+
TEST SUITE: None
71+
```
72+
73+
> **Notice**
74+
>
75+
> This command will install ClickHouse Operator in the namespace `kube-system`. Therefore, ClickHouse Operator only needs to be installed once in a Kubernetes cluster.
76+
4877
### Step 3 : Install RadonDB ClickHouse Cluster
4978
5079
```bash
51-
$ helm install clickhouse ck/clickhouse-cluster
80+
$ helm install --generate-name <repoName>/clickhouse-cluster -n <Namespace>
81+
```
82+
83+
**Expected output:**
84+
85+
```shell
86+
$ helm install clickhouse ck/clickhouse-cluster -n test
87+
NAME: clickhouse
88+
LAST DEPLOYED: Wed Aug 17 14:48:12 2021
89+
NAMESPACE: test
90+
STATUS: deployed
91+
REVISION: 1
92+
TEST SUITE: None
5293
```
5394
5495
### Step 4 : Verification
5596
5697
#### Check the Status of Pod
5798
5899
```bash
59-
kubectl get pods -n <Namespace>
100+
$ kubectl get pods -n <Namespace>
60101
```
61102
62103
**Expected output:**
@@ -66,10 +107,6 @@ $ kubectl get pods -n test
66107
NAME READY STATUS RESTARTS AGE
67108
pod/chi-ClickHouse-replicas-0-0-0 2/2 Running 0 3m13s
68109
pod/chi-ClickHouse-replicas-0-1-0 2/2 Running 0 2m51s
69-
pod/chi-ClickHouse-replicas-1-0-0 2/2 Running 0 2m34s
70-
pod/chi-ClickHouse-replicas-1-1-0 2/2 Running 0 2m17s
71-
pod/chi-ClickHouse-replicas-2-0-0 2/2 Running 0 115s
72-
pod/chi-ClickHouse-replicas-2-1-0 2/2 Running 0 48s
73110
pod/zk-clickhouse-cluster-0 1/1 Running 0 3m13s
74111
pod/zk-clickhouse-cluster-1 1/1 Running 0 3m13s
75112
pod/zk-clickhouse-cluster-2 1/1 Running 0 3m13s
@@ -88,10 +125,6 @@ $ kubectl get service -n test
88125
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
89126
service/chi-ClickHouse-replicas-0-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 2m53s
90127
service/chi-ClickHouse-replicas-0-1 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 2m36s
91-
service/chi-ClickHouse-replicas-1-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 2m19s
92-
service/chi-ClickHouse-replicas-1-1 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 117s
93-
service/chi-ClickHouse-replicas-2-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 50s
94-
service/chi-ClickHouse-replicas-2-1 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 13s
95128
service/clickhouse-ClickHouse ClusterIP 10.96.137.152 <none> 8123/TCP,9000/TCP 3m14s
96129
service/zk-client-clickhouse-cluster ClusterIP 10.107.33.51 <none> 2181/TCP,7000/TCP 3m13s
97130
service/zk-server-clickhouse-cluster ClusterIP None <none> 2888/TCP,3888/TCP 3m13s
@@ -104,18 +137,18 @@ service/zk-server-clickhouse-cluster ClusterIP None <none>
104137
You can directly connect to ClickHouse Pod with `kubectl`.
105138
106139
```bash
107-
kubectl exec -it <pod name> -n <project name> -- clickhouse-client --user=<user name> --password=<user password>
140+
$ kubectl exec -it <podName> -n <Namespace> -- clickhouse-client --user=<userName> --password=<userPassword>
108141
```
109142
110143
**Expected output:**
111144
112145
```shell
113146
$ kubectl get pods |grep clickhouse
114-
clickhouse-s0-r0-0 1/1 Running 0 8m50s
115-
clickhouse-s0-r1-0 1/1 Running 0 8m50s
147+
chi-ClickHouse-replicas-0-0-0 1/1 Running 0 8m50s
148+
chi-ClickHouse-replicas-0-1-0 1/1 Running 0 8m50s
116149

117-
$ kubectl exec -it clickhouse-s0-r0-0 -- clickhouse client -u default --password=C1ickh0use --query='select hostName()'
118-
clickhouse-s0-r0-
150+
$ kubectl exec -it chi-ClickHouse-replicas-0-0-0 -- clickhouse-client -u clickhouse --password=c1ickh0use0perator --query='select hostName()'
151+
chi-ClickHouse-replicas-0-0-0
119152
```
120153
121154
### Use Service
@@ -124,32 +157,16 @@ The Service `spec.type` is `ClusterIP`, so you need to create a client to connec
124157
125158
**Expected output:**
126159
127-
```shell
160+
```
128161
$ kubectl get service |grep clickhouse
129-
clickhouse ClusterIP 10.96.71.193 <none> 9000/TCP,8123/TCP 12m
130-
clickhouse-s0-r0 ClusterIP 10.96.40.207 <none> 9000/TCP,8123/TCP 12m
131-
clickhouse-s0-r1 ClusterIP 10.96.63.179 <none> 9000/TCP,8123/TCP 12m
132-
133-
$ cat client.yaml
134-
apiVersion: v1
135-
kind: Pod
136-
metadata:
137-
name: clickhouse-client
138-
labels:
139-
app: clickhouse-client
140-
spec:
141-
containers:
142-
- name: clickhouse-client
143-
image: tceason/clickhouse-server:v21.1.3.32-stable
144-
imagePullPolicy: Always
145-
146-
$ kubectl apply -f client.yaml
147-
pod/clickhouse-client unchanged
148-
149-
$ kubectl exec -it clickhouse-client -- clickhouse client -u default --password=C1ickh0use -h 10.96.71.193 --query='select hostName()'
150-
clickhouse-s0-r1-0
151-
$ kubectl exec -it clickhouse-client -- clickhouse client -u default --password=C1ickh0use -h 10.96.71.193 --query='select hostName()'
152-
clickhouse-s0-r0-0
162+
clickhouse-ClickHouse ClusterIP 10.96.137.152 <none> 9000/TCP,8123/TCP 12m
163+
chi-ClickHouse-replicas-0-0 ClusterIP None <none> 9000/TCP,8123/TCP 12m
164+
chi-ClickHouse-replicas-0-1 ClusterIP None <none> 9000/TCP,8123/TCP 12m
165+
166+
$ kubectl exec -it clickhouse-ClickHouse -- clickhouse-client -u clickhouse --password=c1ickh0use0perator -h 10.96.137.152 --query='select hostName()'
167+
chi-ClickHouse-replicas-0-1-0
168+
$ kubectl exec -it clickhouse-ClickHouse -- clickhouse-client -u clickhouse --password=c1ickh0use0perator -h 10.96.137.152 --query='select hostName()'
169+
chi-ClickHouse-replicas-0-0-0
153170
```
154171
155172
## Persistence
@@ -161,5 +178,6 @@ In default, PVC mount on the `/var/lib/clickhouse` directory.
161178
162179
2. You should create a PVC that is automatically bound to a suitable PersistentVolume(PV).
163180
164-
> **Note**
181+
> **Notice**
182+
>
165183
> PVC can use different PV, so using the different PV show the different performance.

document/deploy_radondb-clickhouse_operator_on_kubesphere_appstore.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Log in to the KubeSphere Web console as `admin`, and use **Kubectl** from the **
3636
kubectl apply -f https://raw.githubusercontent.com/radondb/radondb-clickhouse-kubernetes/master/clickhouse-operator-install.yml
3737
```
3838

39-
> **注意**
39+
> **Notice**
4040
>
41-
> This command will install ClickHouse Operator in the namespace `kube-system`. Therefore, ClickHouse Operator only needs to be installed once in a Kubernetes cluster.
41+
> This command will install ClickHouse Operator in the namespace `kube-system`. Therefore, ClickHouse Operator only needs to be installed once in a KubeSphere cluster.
4242
4343
```powershell
4444
customresourcedefinition.apiextensions.k8s.io/clickhouseinstallations.clickhouse.altinity.com configured

document/zh/deploy_radondb-clickhouse_operator_on_kubernetes.md

Lines changed: 58 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,61 @@ RadonDB ClickHouse 是基于 [ClickHouse](https://clickhouse.tech/) 的开源、
3636
添加并更新 Helm 仓库。
3737

3838
```bash
39+
$ helm repo add <repoName> https://radondb.github.io/radondb-clickhouse-kubernetes/
40+
$ helm repo update
41+
```
42+
43+
**预期效果**
44+
45+
```shell
3946
$ helm repo add ck https://radondb.github.io/radondb-clickhouse-kubernetes/
47+
"ck" has been added to your repositories
48+
4049
$ helm repo update
50+
Hang tight while we grab the latest from your chart repositories...
51+
...Successfully got an update from the "ck" chart repository
52+
Update Complete. ⎈Happy Helming!
53+
4154
```
4255
4356
### 步骤 2 : 部署 RadonDB ClickHouse Operator
4457
4558
```bash
46-
$ helm install clickhouse-operator ck/clickhouse-operator
59+
$ helm install --generate-name -n <Namespace> <repoName>/clickhouse-operator
4760
```
4861
62+
**预期效果**
63+
64+
```shell
65+
$ helm install clickhouse-operator ck/clickhouse-operator -n kube-system
66+
NAME: clickhouse-operator
67+
LAST DEPLOYED: Wed Aug 17 14:43:44 2021
68+
NAMESPACE: kube-system
69+
STATUS: deployed
70+
REVISION: 1
71+
TEST SUITE: None
72+
```
73+
74+
> **注意**
75+
>
76+
> 上述示例 ClickHouse Operator 将会被安装在 `kube-system` 命名空间下,因此一个 Kubernetes 集群只需要安装一次 ClickHouse Operator。
77+
4978
### 步骤 3 : 部署 RadonDB ClickHouse 集群
5079
5180
```bash
52-
$ helm install clickhouse ck/clickhouse-cluster
81+
$ helm install --generate-name <repoName>/clickhouse-cluster -n <Namespace>
82+
```
83+
84+
**预期效果**
85+
86+
```shell
87+
$ helm install clickhouse ck/clickhouse-cluster -n test
88+
NAME: clickhouse
89+
LAST DEPLOYED: Wed Aug 17 14:48:12 2021
90+
NAMESPACE: test
91+
STATUS: deployed
92+
REVISION: 1
93+
TEST SUITE: None
5394
```
5495
5596
### 步骤 4 : 部署校验
@@ -59,7 +100,7 @@ $ helm install clickhouse ck/clickhouse-cluster
59100
执行如下命令,查看创建的集群 Pod 运行状态。
60101
61102
```bash
62-
kubectl get pods -n <Namespace>
103+
$ kubectl get pods -n <Namespace>
63104
```
64105
65106
**预期结果**
@@ -69,10 +110,6 @@ $ kubectl get pods -n test
69110
NAME READY STATUS RESTARTS AGE
70111
pod/chi-ClickHouse-replicas-0-0-0 2/2 Running 0 3m13s
71112
pod/chi-ClickHouse-replicas-0-1-0 2/2 Running 0 2m51s
72-
pod/chi-ClickHouse-replicas-1-0-0 2/2 Running 0 2m34s
73-
pod/chi-ClickHouse-replicas-1-1-0 2/2 Running 0 2m17s
74-
pod/chi-ClickHouse-replicas-2-0-0 2/2 Running 0 115s
75-
pod/chi-ClickHouse-replicas-2-1-0 2/2 Running 0 48s
76113
pod/zk-clickhouse-cluster-0 1/1 Running 0 3m13s
77114
pod/zk-clickhouse-cluster-1 1/1 Running 0 3m13s
78115
pod/zk-clickhouse-cluster-2 1/1 Running 0 3m13s
@@ -93,10 +130,6 @@ $ kubectl get service -n test
93130
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
94131
service/chi-ClickHouse-replicas-0-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 2m53s
95132
service/chi-ClickHouse-replicas-0-1 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 2m36s
96-
service/chi-ClickHouse-replicas-1-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 2m19s
97-
service/chi-ClickHouse-replicas-1-1 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 117s
98-
service/chi-ClickHouse-replicas-2-0 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 50s
99-
service/chi-ClickHouse-replicas-2-1 ClusterIP None <none> 8123/TCP,9000/TCP,9009/TCP 13s
100133
service/clickhouse-ClickHouse ClusterIP 10.96.137.152 <none> 8123/TCP,9000/TCP 3m14s
101134
service/zk-client-clickhouse-cluster ClusterIP 10.107.33.51 <none> 2181/TCP,7000/TCP 3m13s
102135
service/zk-server-clickhouse-cluster ClusterIP None <none> 2888/TCP,3888/TCP 3m13s
@@ -109,18 +142,18 @@ service/zk-server-clickhouse-cluster ClusterIP None <none>
109142
通过 `kubectl` 工具直接访问 ClickHouse Pod。
110143
111144
```bash
112-
kubectl exec -it <pod name> -n <project name> -- clickhouse-client --user=<user name> --password=<user password>
145+
$ kubectl exec -it <podName> -n <Namespace> -- clickhouse-client --user=<userName> --password=<userPassword>
113146
```
114147
115148
**预期效果**
116149
117150
```shell
118151
$ kubectl get pods |grep clickhouse
119-
clickhouse-s0-r0-0 1/1 Running 0 8m50s
120-
clickhouse-s0-r1-0 1/1 Running 0 8m50s
152+
chi-ClickHouse-replicas-0-0-0 1/1 Running 0 8m50s
153+
chi-ClickHouse-replicas-0-1-0 1/1 Running 0 8m50s
121154

122-
$ kubectl exec -it clickhouse-s0-r0-0 -- clickhouse client -u default --password=C1ickh0use --query='select hostName()'
123-
clickhouse-s0-r0-0
155+
$ kubectl exec -it chi-ClickHouse-replicas-0-0-0 -- clickhouse-client -u clickhouse --password=c1ickh0use0perator --query='select hostName()'
156+
chi-ClickHouse-replicas-0-0-0
124157
```
125158
126159
### 通过 Service
@@ -131,30 +164,14 @@ clickhouse-s0-r0-0
131164
132165
```
133166
$ kubectl get service |grep clickhouse
134-
clickhouse ClusterIP 10.96.71.193 <none> 9000/TCP,8123/TCP 12m
135-
clickhouse-s0-r0 ClusterIP 10.96.40.207 <none> 9000/TCP,8123/TCP 12m
136-
clickhouse-s0-r1 ClusterIP 10.96.63.179 <none> 9000/TCP,8123/TCP 12m
137-
138-
$ cat client.yaml
139-
apiVersion: v1
140-
kind: Pod
141-
metadata:
142-
name: clickhouse-client
143-
labels:
144-
app: clickhouse-client
145-
spec:
146-
containers:
147-
- name: clickhouse-client
148-
image: tceason/clickhouse-server:v21.1.3.32-stable
149-
imagePullPolicy: Always
150-
151-
$ kubectl apply -f client.yaml
152-
pod/clickhouse-client unchanged
153-
154-
$ kubectl exec -it clickhouse-client -- clickhouse client -u default --password=C1ickh0use -h 10.96.71.193 --query='select hostName()'
155-
clickhouse-s0-r1-0
156-
$ kubectl exec -it clickhouse-client -- clickhouse client -u default --password=C1ickh0use -h 10.96.71.193 --query='select hostName()'
157-
clickhouse-s0-r0-0
167+
clickhouse-ClickHouse ClusterIP 10.96.137.152 <none> 9000/TCP,8123/TCP 12m
168+
chi-ClickHouse-replicas-0-0 ClusterIP None <none> 9000/TCP,8123/TCP 12m
169+
chi-ClickHouse-replicas-0-1 ClusterIP None <none> 9000/TCP,8123/TCP 12m
170+
171+
$ kubectl exec -it clickhouse-ClickHouse -- clickhouse-client -u clickhouse --password=c1ickh0use0perator -h 10.96.137.152 --query='select hostName()'
172+
chi-ClickHouse-replicas-0-1-0
173+
$ kubectl exec -it clickhouse-ClickHouse -- clickhouse-client -u clickhouse --password=c1ickh0use0perator -h 10.96.137.152 --query='select hostName()'
174+
chi-ClickHouse-replicas-0-0-0
158175
```
159176
160177
## 持久化
@@ -167,4 +184,5 @@ clickhouse-s0-r0-0
167184
2. 创建一个 PVC 自动绑定到合适的 PersistentVolume。
168185
169186
> **注意**
187+
>
170188
> 在 PersistentVolumeClaim 中,可以配置不同特性的 PersistentVolume。

document/zh/deploy_radondb-clickhouse_operator_on_kubesphere_appstore.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ RadonDB ClickHouse 是基于 [ClickHouse](https://clickhouse.tech/) 的开源、
3030

3131
`admin` 身份登录 KubeSphere 的 Web 控制台,并使用**工具箱**中的 **Kubectl** 执行以下命令来安装 ClickHouse Operator。建议至少准备 2 个可用集群节点。
3232

33-
RadonDB ClickHouse Operator 将会被安装在 `kube-system` 命名空间下,因此一个 KubeSphere 集群只需要安装一次 Operator。
34-
3533
```bash
3634
kubectl apply -f https://raw.githubusercontent.com/radondb/radondb-clickhouse-kubernetes/main/clickhouse-operator-install.yml
3735
```
3836

3937
> **注意**
4038
>
41-
> ClickHouse Operator 将会被安装在 `kube-system` 命名空间下,因此一个 Kubernetes 集群只需要安装一次 ClickHouse Operator。
39+
> RadonDB ClickHouse Operator 将会被安装在 `kube-system` 命名空间下,因此一个 KubeSphere 集群只需要安装一次 ClickHouse Operator。
4240
4341
**预期结果**
4442

0 commit comments

Comments
 (0)