(under development)
This operator is developed with kubebuilder, which can deploy StarRocks CRD resource in kubernetes.
The StarRocks cluster deployed by this operator incldues FE, BE and CN components. These components are running in FQDN mode by default.
If StorageVolume info is not specified in CRD spec, the operator will use emptydir mode to store FE meta and BE data. Please refer to the storageVolume section on how to enable customized storageVolume.
- 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 v2beta2 horizontalpodautoscalers for CN cluster.
Get the official operator image from:operator.
Follow below instructions if you want to build your own image.
# under root directory, compile operator
make build
# build docker image
make docker IMG="xxx"
# push image to docker hub
make push IMG="xxx"
Official FE/CN/BE components images can be found from dockerhub: Those images contains default application configuration file, they can be overritten by configuring kubernetes configmap deployment crd.
For example:
# fe use configmap example
starRocksFeSpec:
configMapInfo:
configMapName: fe-config-map
resolveKey: fe.conf
# cn use configmap example
starRocksCnSpec:
configMapInfo:
configMapName: cn-config-map
resolveKey: cn.conf
# be use configmap example
starRocksBeSpec:
configMapInfo:
configMapName: be-config-map
resolveKey: be.conf
The ConfigMap value is in property format, the following command is an example to generate the configmap from an existing file.
# create fe-config-map from starrocks/fe/conf/fe.conf file
kubectl create configmap fe-config-map --from-file=starrocks/fe/conf/fe.conf
External storage can be used to store FE meta and BE data for persistence. storageVolumes
can be specified in corresponding component spec to enable external storage volumes auto provisioning. Note that the specific storageClassName
should be available in kubernetes cluster before enabling this storageVolume feature.
FE meta storage example
starRocksFeSpec:
storageVolumes:
- name: fe-meta
storageClassName: meta-storage
storageSize: 10Gi
mountPath: /opt/starrocks/fe/meta # overwrite the default meta path
BE data storage example
starRocksBeSpec:
storageVolumes:
- name: be-data
storageClassName: data-storage
storageSize: 1Ti
mountPath: /opt/starrocks/be/storage # overwrite the default data path
deploy
directory contains all the necessary yamls to deploy the operator. Yaml files with leader_
prefix are for operator election if willing to take multiples pods for backup. manager.yaml
is a deployment yaml to deploy operator. Remember to update corresponding image
before applying to kubernetes. Other yamls are facilities objects created for running the operator, include namespace, service account, rbac.
By default, the operator deploys the StarRocks cluster in starrocks
namespace. Either specifying the namespace -n <namespace>
when running kubectl apply
or set the namespace meta field in every yaml files.
cd deploy
# create crd
kubectl apply -f starrocks.com_starrocksclusters.yaml
# create namespace
kubectl apply -f namespace.yaml;
# create rbac-roles the namespace starrocks
kubectl apply -n starrocks -f leader_election_role.yaml
kubectl apply -n starrocks -f role.yaml
# create rbac-role-binding
kubectl apply -n starrocks -f role_binding.yaml
kubectl apply -n starrocks -f leader_election_role_binding.yaml
# create rbac-service-account
kubectl apply -n starrocks -f service_account.yaml
# create operator deployment
# replace image field with image which build in[3]
kubectl apply -n starrocks -f manager.yaml
examples directory contains some simple example for reference.