Deploy on Kubernetes
This section describes how to deploy Doris Operator and Doris cluster in the test Kubernetes cluster. The deployment operations are as follows:
- Deploy Doris Operator
- Deploy Doris cluster
- Connect to Doris cluster
Step 1: Deploy Doris Operator
Deploying Doris Operator consists of two parts: installing the definition and deploying the operator service:
Installing Doris Operator CRD Add the custom resource (CRD) of Doris Operator using the following command:
kubectl create -f https://raw.githubusercontent.com/apache/doris-operator/master/config/crd/bases/doris.apache.com_dorisclusters.yaml
Install Doris Operator Install Doris Operator using the following command:
kubectl apply -f https://raw.githubusercontent.com/apache/doris-operator/master/config/operator/operator.yaml
Expected 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 createdCheck the Doris Operator status Check the deployment status of Doris Operator using the following command:
kubectl get pods -n doris
Expected output:
NAME READY STATUS RESTARTS AGE
doris-operator-7f578c86cb-nz6jn 1/1 Running 0 19m
Step 2: Deploy Doris cluster
- Download the template Doris deployment template:
curl -O https://raw.githubusercontent.com/apache/doris-operator/master/doc/examples/doriscluster-sample.yaml
- Perform customized configuration as needed according to the doc of Config Doris to Deploy. After the configuration is completed, deploy it with the following command:
kubectl apply -f doriscluster-sample.yaml
- Check the cluster deployment status:
Check the status of the cluster by checking the status of pods:Expected output:
kubectl get pods
Check the status of the deployed resources:NAME READY STATUS RESTARTS AGE
doriscluster-sample-fe-0 1/1 Running 0 2m
doriscluster-sample-be-0 1/1 Running 0 3mExpected output:kubectl get dcr -n doris
NAME FESTATUS BESTATUS CNSTATUS BROKERSTATUS
doriscluster-sample available available
Step 3: Access the Doris cluster
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 16mIn 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