{"id":19427786,"url":"https://github.com/starrocks/starrocks-kubernetes-operator","last_synced_at":"2025-05-16T04:05:51.667Z","repository":{"id":41385785,"uuid":"499045218","full_name":"StarRocks/starrocks-kubernetes-operator","owner":"StarRocks","description":"Kubernetes Operator for StarRocks","archived":false,"fork":false,"pushed_at":"2025-05-12T08:21:48.000Z","size":11237,"stargazers_count":156,"open_issues_count":56,"forks_count":78,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-16T04:05:41.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StarRocks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-02T08:00:46.000Z","updated_at":"2025-05-12T08:21:52.000Z","dependencies_parsed_at":"2023-02-18T04:31:05.713Z","dependency_job_id":"bdd218a8-4e91-4477-9790-dcd21a868663","html_url":"https://github.com/StarRocks/starrocks-kubernetes-operator","commit_stats":{"total_commits":373,"total_committers":22,"mean_commits":"16.954545454545453","dds":0.453083109919571,"last_synced_commit":"aea23c31f550f03f5723c2c45deb282fbe1d3017"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarRocks%2Fstarrocks-kubernetes-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarRocks%2Fstarrocks-kubernetes-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarRocks%2Fstarrocks-kubernetes-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarRocks%2Fstarrocks-kubernetes-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StarRocks","download_url":"https://codeload.github.com/StarRocks/starrocks-kubernetes-operator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:12:52.134Z","updated_at":"2025-05-16T04:05:46.659Z","avatar_url":"https://github.com/StarRocks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StarRocks-Kubernetes-Operator\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\u003e English | [中文](README_ZH-CN.md)\n\n## Overview\n\nStarRocks Kubernetes Operator is a project that implements the deployment and operation of StarRocks, a next-generation\nsub-second MPP OLAP database, on Kubernetes. It facilitates the deployment of StarRocks' Frontend (FE), Backend (BE),\nand Compute Node (CN) components within your Kubernetes environment. It also includes Helm chart for easy installation\nand configuration. With StarRocks Kubernetes Operator, you can easily manage the lifecycle of StarRocks clusters, such\nas installing, scaling, upgrading etc.\n\n\u003e [!NOTE]  \n\u003e The StarRocks k8s operator was designed to be a level 2 operator.   See https://sdk.operatorframework.io/docs/overview/operator-capabilities/ to understand more about the capabilities of a level 2 operator. \n\n## Prerequisites\n\n1. Kubernetes version \u003e= 1.18\n2. Helm version \u003e= 3.0\n\n## Features\n\n### Operator Features\n\n- Support deploying StarRocks FE, BE and CN components separately\n  FE component is a must-have component, BE and CN components can be optionally deployed\n- Support multiple StarRocks clusters in one Kubernetes cluster\n- Support external clients outside the network of kubernetes to load data into StarRocks using STREAM LOAD\n- Support automatic scaling for CN nodes based on CPU and memory usage\n- Support mounting persistent volumes for StarRocks containers\n\n### Helm Chart Features\n\n- Support Helm Chart for easy installation and configuration\n    - using kube-starrocks Helm chart to install both operator and StarRocks cluster\n    - using operator Helm Chart to install operator, and using starrocks Helm Chart to install starrocks cluster\n- Support initializing the password of root in your StarRocks cluster during installation.\n- Support integration with other components in the Kubernetes ecosystem, such as Prometheus, Datadog, etc.\n\n## Installation\n\nIn order to use StarRocks in Kubernetes, you need to install:\n\n1. StarRocksCluster CRD\n2. StarRocks Operator\n3. StarRocksCluster CR\n\nThere are two ways to install Operator and StarRocks Cluster.\n\n1. Install Operator and StarRocks Cluster by yaml Manifest.\n2. Install Operator and StarRocks Cluster by Helm Chart.\n\n\u003e Note: In every release, we will provide the latest version of the yaml Manifest and Helm Chart. You can find them\n\u003e in https://github.com/StarRocks/starrocks-kubernetes-operator/releases\n\n## Installation by yaml Manifest\n\nPlease see [Deploy StarRocks With Operator](./doc/deploy_starrocks_with_operator_howto.md) document for more details.\n\n### 1. Apply the StarRocksCluster CRD\n\n```console\nkubectl apply -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/starrocks.com_starrocksclusters.yaml\n```\n\n### 2. Apply the Operator manifest\n\nApply the Operator manifest. By default, the Operator is configured to install in the starrocks namespace. To use the\nOperator in a custom namespace, download\nthe [Operator manifest](https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml)\nand edit all instances of namespace: starrocks to specify your custom namespace.\nThen apply this version of the manifest to the cluster with kubectl apply -f {local-file-path} instead of using the\ncommand below.\n\n```console\nkubectl apply -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml\n```\n\n### 3. Deploy the StarRocks cluster\n\nYou need to prepare a separate yaml file to deploy the StarRocks. The starrocks cluster CRD fields explains\nin [api.md](./doc/api.md). The [examples](./examples/starrocks) directory contains some simple example for reference.\n\nYou can use any of the template yaml file as a starting point. You can further add more configurations into the template\nyaml file following this deployment documentation.\n\nFor demonstration purpose, we use the [starrocks-fe-and-be.yaml](./examples/starrocks/starrocks-fe-and-be.yaml) example\ntemplate to start a 3 FE and 3 BE StarRocks cluster.\n\nHere's an example yaml for Docker Desktop with local desktop access with StarRocks 3.2.1 so you can upgrade in later steps.\n```\natwong@Albert-CelerData sroperatortest % cat starrocks-fe-and-be.yaml\napiVersion: starrocks.com/v1\nkind: StarRocksCluster\nmetadata:\n  name: starrockscluster-sample\n  namespace: starrocks\nspec:\n  starRocksFeSpec:\n    image: starrocks/fe-ubuntu:3.2.1\n    replicas: 3\n    requests:\n      cpu: 1\n      memory: 2Gi\n    limits:\n      cpu: 4\n      memory: 16Gi\n    service:            \n      type: LoadBalancer\n  starRocksBeSpec:\n    image: starrocks/be-ubuntu:3.2.1\n    replicas: 3\n    requests:\n      cpu: 1\n      memory: 2Gi\n    limits:\n      cpu: 4\n      memory: 8Gi\n```\n\n```console\nkubectl apply -f starrocks-fe-and-be.yaml\n```\n\n### 4. Connect the StarRocks cluster\n\nTo connect, just use the mysql client and connect to the StarRocks cluster port 9030.  An example of a connection is shown below. \n\n\u003e [!NOTE]  \n\u003e  If you want to connect remotely or through your desktop, you will need to enable the k8s Load Balander.\n\n```\natwong@Albert-CelerData sroperatortest % kubectl -n starrocks get svc\nNAME                                 TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                       AGE\nstarrockscluster-sample-be-search    ClusterIP      None            \u003cnone\u003e        9050/TCP                                                      5m2s\nstarrockscluster-sample-be-service   ClusterIP      10.103.248.52   \u003cnone\u003e        9060/TCP,8040/TCP,9050/TCP,8060/TCP                           5m2s\nstarrockscluster-sample-fe-search    ClusterIP      None            \u003cnone\u003e        9030/TCP                                                      6m22s\nstarrockscluster-sample-fe-service   LoadBalancer   10.99.14.222    localhost     8030:32326/TCP,9020:32578/TCP,9030:30774/TCP,9010:32505/TCP   6m22s\natwong@Albert-CelerData sroperatortest % mysql -h 127.0.0.1 -P 9030 -uroot\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 3\nServer version: 5.1.0 3.2.1-79ee91d\n\nCopyright (c) 2000, 2024, Oracle and/or its affiliates.\n\nOracle is a registered trademark of Oracle Corporation and/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql\u003e\n```\n\n### 5. Upgrade the StarRocks cluster\n\nTo upgrade, just patch the StarRocks cluster. \n\n```console\nkubectl -n starrocks patch starrockscluster starrockscluster-sample --type='merge' -p '{\"spec\":{\"starRocksFeSpec\":{\"image\":\"starrocks/fe-ubuntu:latest\"}}}'\nkubectl -n starrocks patch starrockscluster starrockscluster-sample --type='merge' -p '{\"spec\":{\"starRocksBeSpec\":{\"image\":\"starrocks/be-ubuntu:latest\"}}}'\n```\n\n### 6. Resize the StarRocks cluster\n\nTo resize, just patch the StarRocks cluster. \n\n\u003e [!IMPORTANT]  \n\u003e  Once you deploy with 3 FE nodes, you are in HA mode.  Do not resize FE nodes below 3 since that will affect cluster quorum.  This rule doesn't apply to CN nodes.\n\n```console\nkubectl -n starrocks patch starrockscluster starrockscluster-sample --type='merge' -p '{\"spec\":{\"starRocksBeSpec\":{\"replicas\":9}}}'\n```\n\n### 7. Delete/stop the StarRocks cluster\n\nTo delete/stop the StarRocks cluster, just execute the delete command.\n\n```console\nkubectl delete -f starrocks-fe-and-be.yaml\n```\nor\n```console\nkubectl delete starrockscluster starrockscluster-sample -n starrocks\n```\n\n### 8. Delete/stop the StarRocks Operator\n\nTo delete/stop the StarRocks Operate, just execute the delete command.\n\n```console\nkubectl delete -f https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/main/deploy/operator.yaml\n```\n\n\n## Installation by Helm Chart\n\nPlease see [kube-starrocks](./helm-charts/charts/kube-starrocks/README.md) for how to install both operator and\nStarRocks cluster by Helm Chart.\n\nIf you want more flexibility in managing your StarRocks clusters, you can deploy Operator\nusing [operator](./helm-charts/charts/kube-starrocks/charts/operator) Helm Chart and StarRocks\nusing [starrocks](./helm-charts/charts/kube-starrocks/charts/starrocks) Helm Chart separately.\n\n## Other Documents\n\n- In [doc](./doc) directory, you can find more documents about how to use StarRocks Operator.\n- In [examples](./examples/starrocks) directory, you can find more examples about how to write StarRocksCluster CR.\n- [Documentation on docs.starrocks.io](https://docs.starrocks.io/docs/deployment/sr_operator/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarrocks%2Fstarrocks-kubernetes-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarrocks%2Fstarrocks-kubernetes-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarrocks%2Fstarrocks-kubernetes-operator/lists"}