This section describes how to deploy Doris Operator and Doris cluster in the test Kubernetes cluster. The deployment operations are as follows:
This step briefly describes how to quickly build a single-node k8s cluster without a k8s cluster. If you already have a k8s cluster, please skip this step. Kind is currently a common solution for creating a local Kubernetes test environment. Kind uses Docker containers as nodes to create and run Kubernetes clusters locally.
| Components | Version requirements |
|---|---|
| Docker | >= 18.09 |
| kubectl | >=1.19 |
| kind | >=0.8.0 |
Deploy Kubernetes cluster using kind In this example, kind 0.10.0 is used to install the Kubernetes cluster. The command is as follows:
kind create cluster --image kindest/node:v1.20.2 --name test-doris
Expected output:
Creating cluster "test-doris" ... ✓ Ensuring node image (kindest/node:v1.20.2) ✓ Preparing nodes ✓ Writing configuration ✓ Starting control-plane ✓ Installing CNI ✓ Installing StorageClass Set kubectl context to "kind-test-doris" You can now use your cluster with:
Check the Kubernetes cluster status Use the following command to check the Kubernetes cluster status:
kubectl cluster-info --context kind-test-doris
Expected output:
Kubernetes control plane is running at https://127.0.0.1:40075 KubeDNS is running at https://127.0.0.1:40075/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Deploying Doris Operator consists of two parts: installing the definition and deploying the operator service:
kubectl apply -f https://raw.githubusercontent.com/selectdb/doris-operator/master/config/crd/bases/doris.selectdb.com_dorisclusters.yamlExpected output:
customresourcedefinition.apiextensions.k8s.io/dorisclusters.doris.selectdb.com created
kubectl apply -f https://raw.githubusercontent.com/selectdb/doris-operator/master/config/operator/operator.yamlExpected output:
namespace/doris created role.rbac.authorization.k8s.io/leader-election-role created rolebinding.rbac.authorization.k8s.io/leader-election-rolebinding created clusterrole.rbac.authorization.k8s.io/doris-operator created clusterrolebinding.rbac.authorization.k8s.io/doris-operator-rolebinding created serviceaccount/doris-operator created deployment.apps/doris-operator created
kubectl get pods -n dorisExpected output:
NAME READY STATUS RESTARTS AGE doris-operator-7f578c86cb-nz6jn 1/1 Running 0 19m
For Doris Operator related configuration and other deployment methods, please refer to Deploying Doris Operator.
curl -O https://raw.githubusercontent.com/apache/doris-operator/master/doc/examples/doriscluster-sample.yaml
kubectl apply -f doriscluster-sample.yaml
kubectl get podsExpected output:
NAME READY STATUS RESTARTS AGE doriscluster-sample-fe-0 1/1 Running 0 2m doriscluster-sample-be-0 1/1 Running 0 3mCheck the status of the deployed resources:
kubectl get dcr -n dorisExpected output:
NAME FESTATUS BESTATUS CNSTATUS BROKERSTATUS doriscluster-sample available available
The Doris cluster is quickly deployed in the test environment. You can enter the container FE and use the MySQL Client to connect to Doris for test operations. For other access methods, refer to Accessing Doris Cluster for configuration.
Get the FE container name:
kubectl get pod -n doris | grep fe doriscluster-sample-fe-0 1/1 Running 0 16m
In this example, the FE container is named doriscluster-sample-fe-0.
Enter the FE container:
kubectl -n doris exec -it doriscluster-sample-fe-0 /bin/bash
Use MySQL Client to connect to the Doris cluster in the FE container:
mysql -uroot -P9030 -h127.0.0.1