The module lifecycle stagePreview

The module has requirements for installation

StarrocksClass

Cluster-wide StarrocksClass resource defines policies for StarRocks analytical database instances: allowed sizing, default FE/BE configuration, and validation rules. Every Starrocks resource must be linked to an existing StarrocksClass. Before deploying the service, all configuration is validated against the corresponding class.

StarrocksClass is immutable — create a new class to change policies.

Sizing Policies

Structure that defines allowed CPU and memory ranges for linked Starrocks instances. This helps avoid uneven resource distribution on cluster nodes and ensures instances are sized appropriately for OLAP workloads. The determining factor for choosing a policy is falling within the cores interval; other fields of the policy are then validated.

spec:
  sizingPolicies:
    - cores:
        min: 2
        max: 4
      memory:
        min: 4Gi
        max: 8Gi
        step: 1Gi
      coreFractions:
        - "50%"
        - "75%"
        - "100%"
    - cores:
        min: 5
        max: 8
      memory:
        min: 8Gi
        max: 16Gi
        step: 1Gi
      coreFractions:
        - "50%"
        - "75%"
        - "100%"
    - cores:
        min: 9
        max: 16
      memory:
        min: 16Gi
        max: 32Gi
        step: 2Gi
      coreFractions:
        - "50%"
        - "75%"
        - "100%"

Validation Rules

CEL (Common Expression Language) is used for flexible validation. Predefined variables available in rule:

  • configuration.catalogTrashExpireSecond
  • configuration.streamingLoadMaxMb
  • instance.memory.size
  • instance.cpu.cores
spec:
  validations:
    - message: "CPU cores must be between 2 and 16"
      rule: "instance.cpu.cores >= 2 && instance.cpu.cores <= 16"
    - message: "Memory size must be at least 4Gi"
      rule: "instance.memory.size >= 4294967296"
    - message: "catalogTrashExpireSecond must be between 600 and 604800 seconds"
      rule: "configuration.catalogTrashExpireSecond >= 600 && configuration.catalogTrashExpireSecond <= 604800"

Overridable Configuration

Whitelist of configuration parameters that users may override in the Starrocks resource. Only keys that update without a restart are allowed here; the CRD CEL rule rejects others. Admin-only or restart-required parameters must be specified exclusively in spec.configuration.

Allowed in overridableConfiguration Apply path Notes
catalogTrashExpireSecond FE: ADMIN SET FRONTEND CONFIG Update via agent without restart
streamingLoadMaxMb BE: POST /api/update_config Update via agent without restart (ADMIN SET BACKEND is not supported)

Do not include enableUdf and loadProcessMaxMemoryLimitPercent in overridableConfiguration (immutable at BE runtime): only class default values are available for them, and changing them requires a new class and a pod restart.

spec:
  overridableConfiguration:
    - catalogTrashExpireSecond
    - streamingLoadMaxMb

Configuration

Default StarRocks FE/BE settings applied to all instances linked to this class. Parameters listed in overridableConfiguration can still be overridden per instance.

Parameter StarRocks config Description
catalogTrashExpireSecond catalog_trash_expire_second FE catalog trash retention before cleanup (seconds)
enableUdf enable_udf Enable User Defined Functions
loadProcessMaxMemoryLimitPercent load_process_max_memory_limit_percent Max BE memory percent for load processes
streamingLoadMaxMb streaming_load_max_mb Max Stream Load request size (MB)
spec:
  configuration:
    catalogTrashExpireSecond: 3600
    enableUdf: true
    loadProcessMaxMemoryLimitPercent: 50
    streamingLoadMaxMb: 204800

Affinity

Standard Kubernetes mechanism for scheduling StarRocks pods onto dedicated nodes (e.g. nodes with fast local storage or high memory).

spec:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: "node.deckhouse.io/group"
          operator: "In"
          values:
          - "analytics"

Tolerations

spec:
  tolerations:
  - key: workload-type
    operator: Equal
    value: analytics
    effect: NoSchedule

Node Selector

spec:
  nodeSelector:
    "node.deckhouse.io/group": "analytics"

Usage Examples

Basic Usage

apiVersion: managed-services.deckhouse.io/v1alpha1
kind: StarrocksClass
metadata:
  labels:
    app.kubernetes.io/name: managed-starrocks-operator
  name: production
spec:
  overridableConfiguration:
    - catalogTrashExpireSecond
    - streamingLoadMaxMb
  configuration:
    catalogTrashExpireSecond: 3600
    enableUdf: true
    loadProcessMaxMemoryLimitPercent: 50
    streamingLoadMaxMb: 204800
  validations:
    - message: "CPU cores must be between 2 and 16"
      rule: "instance.cpu.cores >= 2 && instance.cpu.cores <= 16"
    - message: "Memory size must be between 4Gi and 32Gi"
      rule: "instance.memory.size >= 4294967296 && instance.memory.size <= 34359738368"
  sizingPolicies:
    - cores:
        min: 2
        max: 4
      memory:
        min: 4Gi
        max: 8Gi
        step: 1Gi
      coreFractions:
        - "50%"
        - "75%"
        - "100%"
    - cores:
        min: 5
        max: 8
      memory:
        min: 8Gi
        max: 16Gi
        step: 1Gi
      coreFractions:
        - "50%"
        - "75%"
        - "100%"
    - cores:
        min: 9
        max: 16
      memory:
        min: 16Gi
        max: 32Gi
        step: 2Gi
      coreFractions:
        - "50%"
        - "75%"
        - "100%"