@@ -15,7 +15,7 @@ This topic explains how to install and configure the Databend cluster on Kuberne
15
15
16
16
** Scenario Description**
17
17
18
- - This example demonstrates how to create a Databend cluster within a Kubernetes cluster that supports multi-tenancy. As illustrated, ` tenant1 ` and ` tenant2 ` each have their own independent Databend Query clusters, while sharing a single Databend Meta cluster.
18
+ - This example demonstrates how to create multiple Databend clusters within a Kubernetes cluster.
19
19
- You will need administrative access to the Kubernetes cluster. You can choose any Kubernetes node to work on, but we recommend performing operations on the management node. For this example, you'll need to install both helm and the BendSQL tool on a worker node to execute commands.
20
20
21
21
## Before You Begin
@@ -234,15 +234,15 @@ data-databend-meta-2 Bound pvc-08bd4ceb-15c2-47f3-a637-c1cc10441874 20Gi
234
234
235
235
# ## Step 2. Deploy a Databend Query Cluster
236
236
237
- 1. Create a values file with builtin user ` databend:databend` and cluster name ` example_cluster ` with 3 nodes.
237
+ 1. Create a values file with builtin user ` databend:databend` and cluster name ` cluster1 ` with 3 nodes.
238
238
239
239
Detailed and default values are available at [documentation](https://github.com/databendlabs/helm-charts/blob/main/charts/databend-query/values.yaml)
240
240
241
241
` ` ` yaml
242
242
replicaCount: 3
243
243
config:
244
244
query:
245
- clusterId: example_cluster
245
+ clusterId: cluster1
246
246
# add builtin user
247
247
users:
248
248
- name: databend
@@ -394,13 +394,13 @@ config:
394
394
395
395
````
396
396
397
- 2. Deploy the query cluster for `tenant1 ` in namespace ` databend-query`
397
+ 2. Deploy the query cluster ` cluster1 ` in namespace ` databend-query`
398
398
399
399
` ` ` shell
400
400
helm repo add databend https://charts.databend.com
401
401
helm repo update databend
402
402
403
- helm upgrade --install tenant1 databend/databend-query \
403
+ helm upgrade --install cluster1 databend/databend-query \
404
404
--namespace databend-query --create-namespace \
405
405
--values values.yaml
406
406
` ` `
@@ -410,13 +410,13 @@ helm upgrade --install tenant1 databend/databend-query \
410
410
` ` ` shell
411
411
❯ kubectl -n databend-query get pods
412
412
NAME READY STATUS RESTARTS AGE
413
- tenant1 -databend-query-66647594c-lkkm9 1/1 Running 0 36s
414
- tenant1 -databend-query-66647594c-lpl2s 1/1 Running 0 36s
415
- tenant1 -databend-query-66647594c-4hlpw 1/1 Running 0 36s
413
+ cluster1 -databend-query-66647594c-lkkm9 1/1 Running 0 36s
414
+ cluster1 -databend-query-66647594c-lpl2s 1/1 Running 0 36s
415
+ cluster1 -databend-query-66647594c-4hlpw 1/1 Running 0 36s
416
416
417
417
❯ kubectl -n databend-query get svc
418
418
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
419
- tenant1 -databend-query LoadBalancer 10.43.84.243 172.20.0.2 8080:32063/TCP,9000:31196/TCP,9090:30472/TCP,8000:30050/TCP,7070:31253/TCP,3307:31367/TCP 17m
419
+ cluster1 -databend-query LoadBalancer 10.43.84.243 172.20.0.2 8080:32063/TCP,9000:31196/TCP,9090:30472/TCP,8000:30050/TCP,7070:31253/TCP,3307:31367/TCP 17m
420
420
` ` `
421
421
422
422
4. Access the query cluster
@@ -426,45 +426,45 @@ We use the builtin user `databend` here:
426
426
- in-cluster access
427
427
428
428
` ` ` shell
429
- bendsql -htenant1 -databend-query.databend-query.svc -P8000 -udatabend -pdatabend
429
+ bendsql -hcluster1 -databend-query.databend-query.svc -P8000 -udatabend -pdatabend
430
430
` ` `
431
431
432
432
- outside-cluster access with loadbalancer
433
433
434
434
` ` ` shell
435
- # the address here is the `EXTERNAL-IP` for service tenant1 -databend-query above
435
+ # the address here is the `EXTERNAL-IP` for service cluster1 -databend-query above
436
436
bendsql -h172.20.0.2 -P8000 -udatabend -pdatabend
437
437
` ` `
438
438
439
439
- local access with kubectl
440
440
441
441
` ` ` shell
442
- nohup kubectl port-forward -n databend-query svc/tenant1 -databend-query 3307:3307 &
442
+ nohup kubectl port-forward -n databend-query svc/cluster1 -databend-query 3307:3307 &
443
443
bendsql -h127.0.0.1 -P8000 -udatabend -pdatabend
444
444
` ` `
445
445
446
- 5. Deploy a second cluster for tenant2
446
+ 5. Deploy a second cluster ` cluster2 `
447
447
448
- modify the ` values.yaml` for tenant2
448
+ modify the ` values.yaml` for cluster2
449
449
450
450
` ` ` shell
451
451
# optional
452
452
helm repo update databend
453
453
454
- helm upgrade --install tenant2 databend/databend-query \
454
+ helm upgrade --install cluster2 databend/databend-query \
455
455
--namespace databend-query --create-namespace \
456
456
--values values.yaml
457
457
` ` `
458
458
459
- ` ` ` shell title=" Verify the query service for tenant2 running"
459
+ ` ` ` shell title=" Verify the query service for cluster2 running"
460
460
❯ kubectl -n databend-query get pods
461
461
NAME READY STATUS RESTARTS AGE
462
- tenant1 -databend-query-66647594c-lkkm9 1/1 Running 0 55m
463
- tenant1 -databend-query-66647594c-lpl2s 1/1 Running 0 55m
464
- tenant1 -databend-query-66647594c-4hlpw 1/1 Running 0 55m
465
- tenant2 -databend-query-59dcc4949f-9qg9b 1/1 Running 0 53s
466
- tenant2 -databend-query-59dcc4949f-pfxxj 1/1 Running 0 53s
467
- tenant2 -databend-query-59dcc4949f-mmwr9 1/1 Running 0 53s
462
+ cluster1 -databend-query-66647594c-lkkm9 1/1 Running 0 55m
463
+ cluster1 -databend-query-66647594c-lpl2s 1/1 Running 0 55m
464
+ cluster1 -databend-query-66647594c-4hlpw 1/1 Running 0 55m
465
+ cluster2 -databend-query-59dcc4949f-9qg9b 1/1 Running 0 53s
466
+ cluster2 -databend-query-59dcc4949f-pfxxj 1/1 Running 0 53s
467
+ cluster2 -databend-query-59dcc4949f-mmwr9 1/1 Running 0 53s
468
468
` ` `
469
469
470
470
# # Maintain Databend Query Cluster
@@ -477,10 +477,10 @@ to scale up or down the query cluster, there are two ways
477
477
478
478
` ` ` shell
479
479
# scale query cluster number to 0
480
- kubectl -n databend-query scale statefulset tenant1 -databend-query --replicas=0
480
+ kubectl -n databend-query scale statefulset cluster1 -databend-query --replicas=0
481
481
482
482
# scale query cluster number to 5
483
- kubectl -n databend-query scale statefulset tenant1 -databend-query --replicas=5
483
+ kubectl -n databend-query scale statefulset cluster1 -databend-query --replicas=5
484
484
` ` `
485
485
486
486
- update ` replicaCount` in ` values.yaml` to any value, then helm upgrade again
@@ -491,7 +491,7 @@ to scale up or down the query cluster, there are two ways
491
491
` ` `
492
492
493
493
` ` ` shell
494
- helm upgrade --install tenant1 databend/databend-query \
494
+ helm upgrade --install cluster1 databend/databend-query \
495
495
--namespace databend-query --create-namespace \
496
496
--values values.yaml
497
497
` ` `
@@ -506,7 +506,7 @@ replicaCount: 3
506
506
+ tag: " v0.8.123-nightly"
507
507
config:
508
508
query:
509
- clusterId: example_cluster
509
+ clusterId: cluster1
510
510
` ` `
511
511
512
512
then just run again helm upgrade
@@ -515,7 +515,7 @@ then just run again helm upgrade
515
515
# optional
516
516
helm repo update databend
517
517
518
- helm upgrade --install tenant1 databend/databend-query \
518
+ helm upgrade --install cluster1 databend/databend-query \
519
519
--namespace databend-query --create-namespace \
520
520
--values values.yaml
521
521
` ` `
@@ -626,4 +626,4 @@ After deploying Databend, you might need to learn about the following topics:
626
626
627
627
< ! -- < LanguageFileParse
628
628
cn={< VideoCN /> }
629
- /> -->
629
+ /> -->
0 commit comments