Настройка Kerberos и SSL для StarRocks в Kubernetes с помощью Helm

В данной статье описана активация Kerberos и SSL для StarRocks-кластера в Kubernetes с помощью Helm и kubectl.

ПРИМЕЧАНИЕ
Технически Kerberos и SSL можно настроить для StarRocks в Kubernetes независимо друг от друга. Однако для повышения безопасности рекомендуется использовать Kerberos в сочетании с SSL.

Требования

  • Кластер Kubernetes (версии 1.32 - 1.34) с настроенным доступом через kubectl.

  • Helm (версии 3.8.0 или выше) — пакетный менеджер для быстрого развертывания Docker-образов в Kubernetes.

  • Артефакты StarRocks, включая Docker-образы и Helm-чарты (chart), предварительно загруженные в ваш приватный OCI-реестр. Эти артефакты доступны в offline-пакетах, которые можно запросить у службы поддержки Arenadata. Для деплоя StarRocks в Kubernetes необходимо извлечь следующие образы:

    • hub.arenadata.io/adc-enterprise/starrocks:<version>-adc-<version>-fe

    • hub.arenadata.io/adc-enterprise/starrocks:<version>-adc-<version>-be

    • hub.arenadata.io/adc-enterprise/starrocks-operator:<version>

    Также необходимо извлечь следующие Helm-чарты и загрузить их в ваш приватный реестр:

    • hub.arenadata.io/adc-enterprise/charts/starrocks-operator:<version>

    • hub.arenadata.io/adc-enterprise/charts/starrocks-cluster:<version>

  • Установленный и функционирующий кластер ADH (если предполагается взаимодействие StarRocks c ADH). Версия ADH должна быть совместима с ADH Cloud.

  • Оператор StarRocks, развернутый в Kubernetes согласно инструкции.

  • Оператор Kerberos и CRD Keytab установлены, и настроен KDC. Значение keytab.labelSelector должно совпадать с метками KDC. Принципал в CRD Keytab должен совпадать со значением kerberos_principal в fe.conf и принципалом в конфигурации Ranger.

Процедура развертывания

Шаг 1. Создание секретов Kubernetes

  1. Подготовьте следующие артефакты безопасности:

    • truststore.jks — truststore-файл с сертификатом, используемый компонентами FE/CN для проверки подлинности удаленных сервисов.

    • fe-keystore.jks — keystore-файл, используемый для HTTPS. Должен содержать приватный ключ и соответствующую цепочку сертификатов (certificate chain).

    • ca_certs.crt — сертификат в PEM-формате. Используется для проверки подлинности удаленных сервисов при SSL-соединении.

    • ranger-starrocks.jceks — хранит пароли, используемые Ranger-плагином StarRocks.

  2. Создайте следующие конфигурационные файлы:

    fe.conf
    access_control = ranger
    cloud_native_meta_port = 6090
    enable_fqdn_mode = true
    enable_https = true
    enable_load_volume_from_conf = false
    min_graceful_exit_time_second = 25
    run_mode = shared_data
    sys_log_level = INFO
    ssl_keystore_location = /opt/starrocks/fe/conf/ssl/keystore.jks (1)
    ssl_keystore_password = bigdata
    ssl_key_password = bigdata
    ssl_truststore_location = /opt/starrocks/fe/conf/ssl/truststore.jks (2)
    ssl_truststore_password = bigdata
    ssl_force_secure_transport = true
    kerberos_keytab = /etc/security/keytabs/keytab
    kerberos_principal = starrocks/starrocks.vm.develop.vk.adsw.io@VM.DEVELOP.VK.ADSW.IO (3)
    1 Путь внутри контейнера к keystore-файлу для FE.
    2 Путь внутри контейнера к truststore-файлу для FE.
    3 Принципал Kerberos, который используется FE для аутентификации удаленных сервисов, использующих Kerberos. Значение должно совпадать с принципалом в CRD Keytab и принципалом в конфигурации Ranger.
    cn.conf
    sys_log_level = INFO
    ranger-starrocks-audit.xml
    <configuration>
        <property>
            <name>xasecure.audit.destination.solr</name>
            <value>true</value>
        </property>
        <property>
            <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
            <value>/tmp/ranger/starrocks_plugin/audit_solr_spool</value>
        </property>
        <property>
            <name>xasecure.audit.destination.solr.force.use.inmemory.jaas.config</name>
            <value>True</value>
        </property>
        <property>
            <name>xasecure.audit.destination.solr.zookeepers</name>
            <value>ka-adps.vm.develop.vk.adsw.io:2181/Arenadata.Hadoop-2.solr.server</value> (1)
        </property>
        <property>
            <name>xasecure.audit.is.enabled</name>
            <value>True</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.loginModuleControlFlag</name>
            <value>required</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.loginModuleName</name>
            <value>com.sun.security.auth.module.Krb5LoginModule</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.option.keyTab</name>
            <value>/etc/security/keytabs/keytab</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.option.principal</name> (2)
            <value>starrocks/starrocks.vm.develop.vk.adsw.io@VM.DEVELOP.VK.ADSW.IO</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.option.serviceName</name>
            <value>solr</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.option.storeKey</name>
            <value>False</value>
        </property>
        <property>
            <name>xasecure.audit.jaas.Client.option.useKeyTab</name>
            <value>True</value>
        </property>
    </configuration>
    1 Строка подключения ZooKeeper с chroot, используемая Ranger. Актуальную строку можно получить с помощью zkCli.sh в кластере ADPS.
    2 Kerberos-принципал, используемый для Ranger. Значение должно совпадать с принципалом в CRD Keytab и значением kerberos_principal в fe.conf.
    ranger-starrocks-policymgr-ssl.xml
    <configuration>
        <property>
            <name>xasecure.policymgr.clientssl.truststore</name> (1)
            <value>/opt/starrocks/fe/conf/ssl/truststore.jks</value>
        </property>
        <property>
            <name>xasecure.policymgr.clientssl.truststore.credential.file</name> (2)
            <value>jceks://file/opt/starrocks/fe/conf/ranger-starrocks.jceks</value>
        </property>
    </configuration>
    1 Путь к truststore-файлу, который используется для HTTPS-соединения с Ranger Admin.
    2 Хранилище JCEKS с паролем для доступа к truststore-файлу.
    ranger-starrocks-security.xml
    <configuration>
        <property>
            <name>ranger.plugin.starrocks.policy.cache.dir</name>
            <value>/tmp/ranger/starrocks/policycache</value>
        </property>
        <property>
            <name>ranger.plugin.starrocks.policy.rest.ssl.config.file</name>
            <value>/opt/starrocks/fe/conf/ranger-starrocks-policymgr-ssl.xml</value>
        </property>
        <property>
            <name>ranger.plugin.starrocks.policy.rest.url</name> (1)
            <value>https://ka-adps.vm.develop.vk.adsw.io:6182</value>
        </property>
        <property>
            <name>ranger.plugin.starrocks.policy.source.impl</name>
            <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
        </property>
        <property>
            <name>ranger.plugin.starrocks.service.name</name> (2)
            <value>starrocks_k8s</value>
        </property>
        <property>
            <name>ranger.plugin.starrocks.use.rangerGroups</name>
            <value>True</value>
        </property>
    </configuration>
    1 Ranger Admin REST URL.
    2 Имя Ranger-сервиса для кластера StarRocks.
  3. Если предполагается взаимодействие StarRocks с внешним ADH-кластером, создайте конфигурационные файлы (core-site.xml, hdfs-site.xml, hive-site.xml), используя следующие примеры в качестве шаблона. Параметры конфигурации в этих файлах необходимо заменить значениями из вашего ADH-кластера.

    core-site.xml
    <?xml version="1.0"?>
    <configuration>
            <property>
                    <name>fs.defaultFS</name>
                    <value>hdfs://adh</value> (1)
            </property>
            <property>
                    <name>hadoop.security.authentication</name>
                    <value>simple</value>
            </property>
    </configuration>
    1 Замените значением из файла /etc/hadoop/conf/core-site.xml вашего ADH-кластера.
    hdfs-site.xml

    Замените все параметры в файле значениями из /etc/hadoop/conf/hdfs-site.xml вашего ADH-кластера.

    <?xml version="1.0"?>
    <configuration>
            <property>
                    <name>dfs.nameservices</name>
                    <value>adh</value>
            </property>
            <property>
                    <name>dfs.ha.namenodes.adh</name>
                    <value>nn_ka-adh-1,nn_ka-adh-2</value>
            </property>
            <property>
                    <name>dfs.namenode.rpc-address.adh.nn_ka-adh-1</name>
                    <value>ka-adh-1.ru-central1.internal:8020</value>
            </property>
            <property>
                    <name>dfs.namenode.rpc-address.adh.nn_ka-adh-2</name>
                    <value>ka-adh-2.ru-central1.internal:8020</value>
            </property>
            <property>
                    <name>dfs.client.failover.proxy.provider.adh</name>
                   <value>org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider</value>
            </property>
    </configuration>
    hive-site.xml
    <?xml version="1.0"?>
    <configuration>
        <property>
                <name>hive.metastore.uris</name>
                <value>thrift://ka-adh-2.ru-central1.internal:9083</value> (1)
        </property>
        <property>
                <name>metastore.use.SSL</name>
                <value>False</value>
        </property>
        <property>
                <name>hive.metastore.sasl.enabled</name>
                <value>False</value>
        </property>
    </configuration>
    1 Замените значением из файла /etc/hive/conf/hive-site.xml вашего ADH-кластера.
    РЕКОМЕНДАЦИЯ
    Файлы конфигурации вашего ADH-кластера находятся на хостах кластера в директориях /etc/hadoop/conf/ и /etc/hive/conf/.
  4. Создайте неймспейс:

    $ kubectl create namespace starrocks-helm
  5. Создайте секреты Kubernetes:

    $ kubectl create secret generic fe-conf --namespace starrocks-helm --from-file=fe.conf=fe.conf
    $ kubectl create secret generic cn-conf --namespace starrocks-helm --from-file=cn.conf=cn.conf
    $ kubectl create secret generic root-pwd --namespace starrocks-helm --from-literal=password='<password>'
    $ kubectl create secret generic existing-starrocks-ssl --namespace starrocks-helm --from-file=truststore.jks=truststore.jks --from-file=keystore.jks=fe-keystore.jks
    $ kubectl create secret generic starrocks-cluster-configs-ranger --namespace starrocks-helm --from-file=ranger-starrocks-audit.xml=ranger-starrocks-audit.xml --from-file=ranger-starrocks-policymgr-ssl.xml=ranger-starrocks-policymgr-ssl.xml --from-file=ranger-starrocks-security.xml=ranger-starrocks-security.xml --from-file=ranger-starrocks.jceks=ranger-starrocks.jceks
    $ kubectl create secret generic existing-starrocks-ca --namespace starrocks-helm --from-file=ca.crt=ca_certs.crt
  6. Проверьте созданные секреты:

    $ kubectl get secrets -n starrocks-helm

    Пример вывода:

    cn-conf                                   Opaque               1      1d5h
    fe-conf                                   Opaque               1      1d5h
    root-pwd                                  Opaque               1      1d5h
    starrocks-cluster-configs-ranger          Opaque               4      42s
    existing-starrocks-ssl                    Opaque               2      12s
    existing-starrocks-ca                     Opaque               1      30s

Шаг 2. Установка кластера StarRocks

  1. Создайте файл Helm values starrocks-cluster-values.yaml:

    starrocks-cluster-values.yaml
    # Replace the chart name (starrocks-cluster) used in the default name of the resources this chart creates.
    nameOverride: ""
    
    # Override the fully qualified app name. Defaults to <release>-starrocks-cluster (or just <release> when the release
    # name already contains the chart name).
    fullnameOverride: ""
    
    ## Controls whether changes to referenced Secrets trigger an automatic pod rollout.
    ## Set enabled: false to update referenced Secrets without restarting the workload;
    ## pods keep running the previous configuration until the policy is re-enabled.
    ## Defaults to enabled (true); the block is rendered on the Cluster CR only when disabled (false).
    ##
    #configurationRollout:
    #  enabled: true
    
    ## Root password of the StarRocks cluster: the name of an existing Secret with the password under the
    ## `password` key. With it set, a Job sets the password on FE after `helm install` and every `helm upgrade`
    ## (it does nothing once the password is set), and MYSQL_PWD of FE and CN is filled from the Secret
    ## unless a component sets MYSQL_PWD in its envs. Without it root keeps the empty password.
    ##
    rootPassword:
      secretName: root-pwd (1)
    #  ## query_port of fe.conf, when it is not the default.
    #  queryPort: 9030
    #  ## The security contexts of the init password Job, overridable wholesale.
    #  podSecurityContext:
    #    fsGroup: 1000
    #  securityContext:
    #    runAsUser: 1000
    #    runAsGroup: 1000
    #    runAsNonRoot: true
    #    allowPrivilegeEscalation: false
    #    readOnlyRootFilesystem: true
    #    capabilities:
    #      drop: ["ALL"]
    #    seccompProfile:
    #      type: RuntimeDefault
    
    ## Ranger plugin on FE. The plugin files are yours: name a Secret and the keys of it the plugin reads,
    ## and the chart mounts all of them into /opt/starrocks/fe/conf, next to fe.conf. Set
    ## access_control = ranger in the fe.conf of fe.configsSecretName to turn the plugin on.
    ranger:
      ## Name of an existing Secret with the plugin files. Set it to enable Ranger.
      secretName: "starrocks-cluster-configs-ranger" (2)
    
    ## Hadoop client configuration (*-site.xml) of the external catalogs, mounted into the conf dir of FE and CN.
    ## See "Hadoop configuration (hadoopConfigs)" in the README.
    hadoopConfigs: (3)
      ## Name of an existing Secret with the *-site.xml files.
      secretName: ""
    
    ## Kerberos authentication of the FE, which then talks to Hive, HDFS and Ranger as a principal of
    ## the realm. The block is optional; without it FE runs unauthenticated. The operator mounts the keytab
    ## Secret at /etc/security/keytabs and its krb5.conf key at /etc/krb5.conf. Rotating the keytab does not
    ##  restart FE.
    ##
    kerberos: (4)
      ## Realm of the KDC, the realm part of the principal, as it appears in a keytab: EXAMPLE.COM.
      realm: VM.DEVELOP.VK.ADSW.IO
      ## First component of the FE principal and the name of the service in Ranger Admin.
      ## Defaults to starrocks, the name the plugin registers its service by.
      service: starrocks
      ## Hostname of the FE, the host part of the principal: *.<hostname>@<realm>.
      hostname: starrocks.vm.develop.vk.adsw.io
      keytab:
        ## Renders a Keytab CR that kerberos-operator keeps up to date. It needs the
        ## krb5.arenadata.io CRDs in the cluster and a labelSelector to reach the KDC.
        ## Leave it off to mount a Secret that already exists.
        create: true
        ## Name of the Secret with the `keytab` and `krb5.conf` keys, the one to create or the one to
        ## mount. Defaults to the name of this release.
        secretName: ""
        ## Labels of the KDC the Keytab CR asks for the principal, as a map of label to value.
        labelSelector:
          env: prod
        ## Principals of other services to put into the same keytab.
        additionalPrincipals: []
        ## Keytab CR only: how often kerberos-operator regenerates the keytab, and how often it checks
        ## whether it is due. Both are Go durations, for example 24h and 1m.
    #    rotation:
    ##      ## Regenerating the Secret refreshes the files in the pods, it does not restart them.
    #      interval: ""
    #      checkInterval: ""
    
    ## Image pull Secret, referenced by name in the imagePullSecrets of both components. Either name an
    ## existing Secret, or give credentials and let the chart create <fullname>-docker-config. The
    ## components pull from the same registry, so one Secret covers FE and CN.
    imagePullSecret: (5)
      ## Name of an existing image pull Secret. The chart creates nothing then.
      name: ""
    
      ## Credentials the chart builds the image pull Secret from, all three keys together. The chart
      ## creates <fullname>-docker-config from them, so a values file carries the password in the clear.
      credentials: {}
      #  registry: private-docker-registry
      #  username: user
      #  password: pass
    
    ## JKS stores of FE, mounted at /opt/starrocks/fe/conf/ssl. A key store turns TLS on; its passwords
    ## go into your own fe.conf. See "SSL and CA" in the README.
    ##
    ssl:
      secretName: existing-starrocks-ssl (6)
      trustStoreKey: truststore.jks
      keyStoreKey: keystore.jks
    
    ## The CA CN verifies FE with, mounted at /opt/starrocks/cn/conf/ca. Requires ssl.keyStoreKey.
    ##
    ca:
      secretName: existing-starrocks-ca (7)
      certificateKey: ca.crt
    
    ## LDAP search of FE (authentication_ldap_simple). The authentication_ldap_simple_* keys go into your own
    ## fe.conf; the chart only fills the admin account they reference as ${LDAP_BIND_ROOT_DN} and
    ## ${LDAP_BIND_ROOT_PWD}. A direct bind by the DN on the user or by a DN pattern
    ## (authentication_ldap_simple_bind_dn_pattern) needs no ldap at all.
    ## See "LDAP authentication" in the README.
    ##
    #ldap:
    #  ## Existing Secret with the admin account of the search, keys bind-root-dn and bind-root-password.
    #  secretName: existing-starrocks-ldap
    
    ## Component FE: keeps the cluster metadata. Configuration and credentials come from the existing
    ## configsSecretName, which is mounted over the conf directory and replaces the whole directory.
    fe:
    
      ## Name of the existing Secret that carries fe.conf. Required.
      configsSecretName: "fe-conf" (8)
    
      ## Number of replicas.
      replicas: 1
    
      image: (9)
        registry: "<registry>"
        repository: "<repository>"
        tag: "<version>"
        pullPolicy: ""
    
      ## Set container requests and limits for resource like CPU or memory (essential for production workloads).
      ## Rendered as spec.resources of the component on the Cluster CR.
      ##
      resources: {}
        #limits:
        #  cpu: "4"
        #  memory: "8Gi"
        #requests:
      #  cpu: "4"
      #  memory: "4Gi"
    
      ## Persistent volumes of the component, rendered as a `storageVolumes` list on the Cluster CR in order.
      ## Every entry needs `name` and `mountPath`. The operator creates one PVC per entry, named after `name`,
      ## with ReadWriteOnce; `emptyDir` mounts a scratch directory instead of a PVC.
      ## A `storageSize` starting with `0` drops the volume.
      ## Conventional values: fe-meta at /opt/starrocks/fe/meta, cn-storage at /opt/starrocks/cn/storage.
      storageVolumes: (10)
        - name: fe-meta
          mountPath: /opt/starrocks/fe/meta
          storageSize: 10Gi
          storageClassName: "<yourStorageClassName>"
          subPath: ""
    
      ## Pod-level security context applied to the pod (rendered as spec.fe.spec.podSecurityContext).
      ## The operator already sets fsGroup 1000 so the mounted Secrets (mode 0440) stay readable;
      ## fields set here override that default.
      ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
      ##
      podSecurityContext: {}
      #  runAsUser: 1000
      #  runAsGroup: 1000
      #  fsGroup: 1000
    
      ## Container-level security context applied to the container (rendered as spec.fe.spec.securityContext).
      ## The container runs as the starrocks user (uid/gid 1000) with a read-only root filesystem,
      ## every capability dropped and the RuntimeDefault seccomp profile; fields set here override
      ## that default, e.g. runAsUser: 0 switches back to root, readOnlyRootFilesystem: false makes
      ## the installation writable again.
      ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
      ##
      securityContext: {}
      #  runAsNonRoot: true
      #  readOnlyRootFilesystem: true
    
      ## Name of an existing ServiceAccount the component pods run as. The chart never creates it.
      ## Empty leaves the operator without a ServiceAccount, so the pods use the namespace default one.
      serviceAccount: ""
    
      ## terminationGracePeriodSeconds defines duration in seconds the FE pod needs to terminate gracefully.
      ## the default value is 120 seconds
      #
      # terminationGracePeriodSeconds: 120
    
      ## Add annotations to the metadata of the component.
      annotations: {}
    
      ## nodeSelector: Object defining constraints to place pods on a specific set of Nodes.
      nodeSelector: {}
    
      ## Allow a Pod to be scheduled onto nodes that have taints.
      ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
      ##
      tolerations: []
        # - key: "example-key"
      #   operator: "Exists"
      #   effect: "NoSchedule"
    
      ## affinity: Object defining soft rules to place pods on a specific set of Nodes.
      affinity: {}
      #  nodeAffinity:
      #      requiredDuringSchedulingIgnoredDuringExecution:
      #        nodeSelectorTerms:
      #        - matchExpressions:
      #          - key: topology.kubernetes.io/zone
      #            operator: In
      #            values:
      #            - antarctica-east1
    
      ## topologySpreadConstraints for scheduling pods across failure-domains.
      ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
      ##
      topologySpreadConstraints: []
      #  - maxSkew: 1
      #    topologyKey: topology.kubernetes.io/zone
      #    whenUnsatisfiable: DoNotSchedule
    
      ## Additional environment variables for the container. With rootPassword the chart adds MYSQL_PWD,
      ## unless an entry here sets it.
      envs: []
      #  - name: JAVA_TOOL_OPTIONS
      #    value: >-
      #      -Djavax.net.ssl.trustStore=/opt/starrocks/fe/conf/ssl/truststore.jks
      #      -Djavax.net.ssl.trustStorePassword=bigdata
    
      ## Mount additional secrets into the pod.
      ## configsSecretName already covers the conf directory, so an entry here must not repeat that
      ## path. The chart renders the config secret and these entries as the `secrets` of the
      ## component, the config secret first. Only the subPath option is supported, the same set the
      ## Cluster CR carries.
      ##
      mountSecrets: []
      #  - name: my-secret
      #    mountPath: /etc/starrocks/my-secret
      #    subPath: ""
    
    ## Component CN: computes. Configuration and credentials come from the existing configsSecretName,
    ## which is mounted over the conf directory and replaces the whole directory.
    cn:
    
      ## Name of the existing Secret that carries cn.conf. Required.
      configsSecretName: "cn-conf" (11)
    
      ## Number of replicas.
      replicas: 1
    
      ## CN runs from the BE image (the fork ships no separate CN image).
      ## All three fields are required: an empty one fails the render.
      image: (12)
        registry: "<registry>"
        repository: "<repository>"
        tag: "<version>"
        pullPolicy: ""
    
      ## Set container requests and limits for resource like CPU or memory (essential for production workloads).
      ## Rendered as spec.resources of the component on the Cluster CR.
      ##
      resources: {}
        #limits:
        #  cpu: "8"
        #  memory: "8Gi"
        #requests:
      #  cpu: "4"
      #  memory: "8Gi"
    
      ## Persistent volumes of the component, rendered as a `storageVolumes` list on the Cluster CR in order.
      ## Every entry needs `name` and `mountPath`. The operator creates one PVC per entry, named after `name`,
      ## with ReadWriteOnce; `emptyDir` mounts a scratch directory instead of a PVC.
      ## A `storageSize` starting with `0` drops the volume.
      ## Conventional values: fe-meta at /opt/starrocks/fe/meta, cn-storage at /opt/starrocks/cn/storage.
      storageVolumes: []
      #  - name: cn-storage
      #    mountPath: /opt/starrocks/cn/storage
      #    storageSize: 1Ti
      #    storageClassName: ""
      #    subPath: ""
    
      ## Pod-level security context applied to the pod (rendered as spec.cn.spec.podSecurityContext).
      ## The operator already sets fsGroup 1000 so the mounted Secrets (mode 0440) stay readable;
      ## fields set here override that default.
      ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
      ##
      podSecurityContext: {}
      #  runAsUser: 1000
      #  runAsGroup: 1000
      #  fsGroup: 1000
    
      ## Container-level security context applied to the container (rendered as spec.cn.spec.securityContext).
      ## The container runs as the starrocks user (uid/gid 1000) with a read-only root filesystem,
      ## every capability dropped and the RuntimeDefault seccomp profile; fields set here override
      ## that default, e.g. runAsUser: 0 switches back to root, readOnlyRootFilesystem: false makes
      ## the installation writable again.
      ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
      ##
      securityContext: {}
      #  runAsNonRoot: true
      #  readOnlyRootFilesystem: true
    
      ## Name of an existing ServiceAccount the component pods run as. The chart never creates it.
      ## Empty leaves the operator without a ServiceAccount, so the pods use the namespace default one.
      serviceAccount: ""
    
      ## terminationGracePeriodSeconds defines duration in seconds the CN pod needs to terminate gracefully.
      ## the default value is 120 seconds
      #
      # terminationGracePeriodSeconds: 120
    
      ## Add annotations to the metadata of the component.
      annotations: {}
    
      ## nodeSelector: Object defining constraints to place pods on a specific set of Nodes.
      nodeSelector: {}
    
      ## Allow a Pod to be scheduled onto nodes that have taints.
      ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
      ##
      tolerations: []
        # - key: "example-key"
      #   operator: "Exists"
      #   effect: "NoSchedule"
    
      ## affinity: Object defining soft rules to place pods on a specific set of Nodes.
      affinity: {}
      #  nodeAffinity:
      #      requiredDuringSchedulingIgnoredDuringExecution:
      #        nodeSelectorTerms:
      #        - matchExpressions:
      #          - key: topology.kubernetes.io/zone
      #            operator: In
      #            values:
      #            - antarctica-east1
    
      ## topologySpreadConstraints for scheduling pods across failure-domains.
      ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
      ##
      topologySpreadConstraints: []
      #  - maxSkew: 1
      #    topologyKey: topology.kubernetes.io/zone
      #    whenUnsatisfiable: DoNotSchedule
    
      ## Additional environment variables for the container. With rootPassword the chart adds MYSQL_PWD,
      ## unless an entry here sets it.
      envs: []
      #  - name: SSL_CERT_FILE
      #    value: /etc/ssl/outbound/ca-certificates.crt
    
      ## Mount additional secrets into the pod.
      ## configsSecretName already covers the conf directory, so an entry here must not repeat that
      ## path. The chart renders the config secret and these entries as the `secrets` of the
      ## component, the config secret first. Only the subPath option is supported, the same set the
      ## Cluster CR carries.
      ##
      mountSecrets: []
      #  - name: existing-outbound-ca
      #    mountPath: /etc/ssl/outbound/ca-certificates.crt
      #    subPath: ca-certificates.crt
    1 Секрет с root-паролем для кластера StarRocks.
    2 Секрет с конфигурацией Ranger.
    3 Секрет с конфигурацией кластера ADH.
    4 Параметры Kerberos.
    5 Если используется приватный OCI-реестр, укажите имя секрета для доступа к реестру.
    6 Секрет с файлами keystore/truststore.
    7 Секрет с CA-сертификатом.
    8 Секрет с конфигурацией компонента Frontend (FE).
    9 Путь к образу FE.
    10 Создает том персистентного хранилища (PersistentVolumeClaim, PVC) для метаданных FE и монтирует его внутри контейнера FE. Идея заключается в том, чтобы один раз создать PVC для FE-метаданных, а затем подключать его к FE-подам, например, при рестарте пода. Если закоментировать данный блок настроек, FE-метаданные будут генерироваться заново при каждом запуске контейнера FE.
    11 Секрет с конфигурацией компонента Compute Node (CN).
    12 Путь к образу CN.
  2. Установите кластер StarRocks:

    $ helm upgrade --install starrocks-cluster oci://<registry-address>/ng/charts/starrocks-cluster:<version> -f starrocks-cluster-values.yaml --namespace starrocks-helm

    Результат:

    Pulled: hub.adsw.io/ng/charts/starrocks-cluster:0.19.0
    Digest: sha256:4d830f08aa1a6143df67e4ee3fe893255a8630cc4ae1a85170aa5ef3b905b637
    Release "starrocks-cluster" has been upgraded. Happy Helming!
    NAME: starrocks-cluster
    LAST DEPLOYED: Fri Nov 20 19:56:09 2026
    NAMESPACE: starrocks-helm
    STATUS: deployed
    REVISION: 2
    DESCRIPTION: Upgrade complete
    TEST SUITE: None
  3. Проверьте установку кластера с помощью следующих команд:

    $ kubectl get clusters.starrocks.arenadata.io -n starrocks-helm
    $ kubectl get pods -n starrocks-helm

    Вывод:

    konstantin@ka-starrocks-k8s-demo:~$ kubectl get clusters.starrocks.arenadata.io -n starrocks-helm
    NAME                PHASE     FESTATUS   BESTATUS   CNSTATUS   FEPROXYSTATUS
    starrocks-cluster   running   running               running
    konstantin@ka-starrocks-k8s-demo:~$ kubectl get pods -n starrocks-helm
    NAME                              READY   STATUS      RESTARTS   AGE
    starrocks-cluster-cn-0            1/1     Running     0          2d1h
    starrocks-cluster-fe-0            1/1     Running     0          2d1h
    starrocks-cluster-initpwd-cvtwc   0/1     Completed   0          2d1h

    Убедитесь, что кластер и все поды кластера находятся в состоянии Running.

Шаг 3. Подключение к кластеру StarRocks

Для внешнего доступа к кластеру StarRocks необходимо открыть HTTPS/SQL эндпойнты сервиса, например, используя LoadBalancer или Ingress-контроллер. Все настройки, связанные с публикацией сервиса, включая DNS, аннотации, параметры Ingress/LoadBalancer и прочие, должны быть указаны в соответствии с вашей инфраструктурой Kubernetes.

В следующем примере показано подключение JDBC-клиента (DBeaver) к контейнеру StarRocks FE через LoadBalancer, который пробрасывает порт 9030, используемый для SQL-запросов.

  1. Получите внешний IP-адрес балансировщика. Например:

    NAME           TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                                        AGE
    starrocks-lb   LoadBalancer   10.254.22.166   160.5.216.252   9030:32081/TCP,8030:31278/TCP,8443:31309/TCP   6m37s

    Скопируйте IP-адрес EXTERNAL-IP для дальнейших шагов.

  2. Подключитесь к кластеру StarRocks по JDBC, например, с помощью DBeaver. Строка JDBC-подключения имеет следующий вид:

    jdbc:mysql://<external-ip>:9030/

    где <external-ip> — IP-адрес балансировщика из предыдущего шага.

    ПРИМЕЧАНИЕ

    Для подключения к кластеру StarRocks с включенным SSL, необходимо указать следующие параметры в настройках MySQL-драйвера:

    • useSSL=True

    • sslMode=VERIFY_CA

    • trustCertificateKeyStorePassword=bigdata

    • trustCertificateKeyStoreType=JKS

    • trustCertificateKeyStoreUrl=file:<path/to/mytruststore.jks>

  3. Установив подключение, выполните тестовую команду для проверки работоспособности кластера:

    SHOW CATALOGS;

    Вывод:

    Catalog        |Type    |Comment                                                         |
    ---------------+--------+----------------------------------------------------------------+
    default_catalog|Internal|An internal catalog contains this cluster's self-managed tables.|
Нашли ошибку? Выделите текст и нажмите Ctrl+Enter чтобы сообщить о ней