English | 中文
Using kubebuilder, a framework that enables the deployment of StarRocks Custom Resource Definition (CRD) resources within a Kubernetes environment.
The Kubernetes Operator provided by StarRocks facilitates the deployment of StarRocks' Front End (FE), Back End (BE), and Compute Node (CN) components within your Kubernetes environment. By default, these components operate in FQDN (fully qualified domain name) mode.
- kubernetes 1.18+
- golang 1.18+
- FE decouples with CN and BE. FE is a must-have component, BE and CN can be optionally deployed.
- Support v2 horizontalpodautoscalers for CN cluster.
Apply the custom resource definition (CRD) for the Operator:
kubectl apply -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/starrocks.com_starrocksclusters.yaml
Apply the Operator manifest. By default, the Operator is configured to install in the starrocks namespace. To use the Operator in a custom namespace, download the Operator manifest and edit all instances of namespace: starrocks to specify your custom namespace. Then apply this version of the manifest to the cluster with kubectl apply -f {local-file-path} instead of using the command below.
kubectl apply -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml
You need to prepare a separate yaml file to deploy the StarRocks FE, BE and CN components. The starrocks cluster CRD fields explains in api.md. The examples directory contains some simple example for reference.
You can use any of the template yaml file as a starting point. You can further add more configurations into the template yaml file following this deployment documentation.
For demonstration purpose, we use the starrocks-fe-and-be.yaml example template to start a 3 FE and 3 BE StarRocks cluster.
kubectl apply -f starrocks-fe-and-be.yaml
After deploying the StarRocks cluster, you can use kubectl get svc -n <namespace>
to find the IP to connect to. For
example if the namespace that starrocks is deployed into is starrocks
, you can:
kubectl get svc -n starrocks
<your-StarRocksCluster-name>-fe-service
's clusterIP is the IP to use to connect to StarRocks FE.
Delete the custom resource:
kubectl delete -f starrocks-fe-and-be.yaml
Remove the Operator:
kubectl delete -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml
StarRocks has embraced Helm for its deployment needs. You can find the Helm chart for StarRocks at artifacthub.
See deploy_starrocks_with_helm.md for more details.
There are more documents in the doc directory.