Cloud Native 11 min read

Deploy StarRocks Quickly with Docker and Kubernetes: Step‑by‑Step Guide

This guide explains how to set up a StarRocks cluster using Docker for rapid testing and the StarRocks Kubernetes Operator for production‑grade deployments, covering architecture basics, required tools, command‑line steps, YAML configuration, and connection methods for both internal and external access.

StarRocks
StarRocks
StarRocks
Deploy StarRocks Quickly with Docker and Kubernetes: Step‑by‑Step Guide

What is Cloud‑Native StarRocks?

StarRocks is an MPP analytical database that, since version 3.0, supports a cloud‑native storage‑separation architecture. Deploying it in cloud environments brings elasticity, portability, high reliability, and automated management, which significantly improve cost efficiency and development speed.

StarRocks Architecture Overview

The system consists of a Frontend (FE) node that handles metadata, client connections, query planning and scheduling, and one or more Backend (BE) nodes that store data and execute SQL.

Prerequisites

Docker (latest version)

MySQL client (to connect to StarRocks)

A Kubernetes cluster (Docker Desktop with Kubernetes, Minikube, or any managed K8s service such as Alibaba Cloud ACK, Tencent Cloud TKE, AWS EKS, GCP GKE)

1. Quick Test with Docker

For fast functional verification, run a single‑node StarRocks container that includes one FE and one BE. This setup is intended for demos or small‑data tests only.

docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd starrocks/allin1-ubuntu:latest

After the container starts, wait about a minute, then connect using the MySQL client:

mysql -h127.0.0.1 -P9030 -uroot

2. Deploy with the StarRocks Kubernetes Operator

Install the Operator

Apply the CustomResourceDefinition (CRD) that defines a StarRocksCluster:

kubectl apply -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/starrocks.com_starrocksclusters.yaml

Then install the Operator itself in the default starrocks namespace (or a custom namespace of your choice):

kubectl apply -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml

Deploy a Cluster

Create a YAML manifest that describes the desired number of FE, BE, and CN (compute) nodes. The repository provides a sample starrocks-fe-and-be.yaml which launches three FE and three BE by default; you can edit it to set replication_num=1 and adjust node counts.

wget https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/examples/starrocks/starrocks-fe-and-be.yaml
kubectl apply -f starrocks-fe-and-be.yaml

Connect to the Cluster

Inside the Kubernetes network, obtain the FE service IP: kubectl get svc -n starrocks The service name follows the pattern <cluster-name>-fe-service. Use the IP to connect: mysql -h <FE-IP> -P9030 -uroot For external access, change the FE service type to LoadBalancer or NodePort:

kubectl -n starrocks patch --type=merge src starrockscluster-sample -p '{"spec":{"starRocksFeSpec":{"service":{"type": "LoadBalancer"}}}}'

After the service obtains an ExternalIP, connect from outside the cluster using the same MySQL command.

Reference Links

Docker installation guide: https://docs.docker.com/engine/install/

StarRocks Docker Hub tags: https://hub.docker.com/r/starrocks/allin1-ubuntu/tags

StarRocks Kubernetes Operator repository: https://github.com/StarRocks/starrocks-kubernetes-operator

Operator CRD and manifest files: https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/starrocks.com_starrocksclusters.yaml and https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml

Example YAML templates: https://github.com/StarRocks/starrocks-kubernetes-operator/tree/main/examples/starrocks

Following these steps lets you quickly verify StarRocks functionality with Docker and scale to a production‑grade, cloud‑native deployment using Kubernetes.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerKubernetesStarRocks
StarRocks
Written by

StarRocks

StarRocks is an open‑source project under the Linux Foundation, focused on building a high‑performance, scalable analytical database that enables enterprises to create an efficient, unified lake‑house paradigm. It is widely used across many industries worldwide, helping numerous companies enhance their data analytics capabilities.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.