<@U0A71G31CDV> Based off of the kubernetes operato...
# questions-and-troubleshooting
d
@Rocky Based off of the kubernetes operator https://github.com/StarRocks/starrocks-kubernetes-operator/blob/main/examples/starrocks/deploy_a_starrocks_cluster_with_cn.yaml What is the default disk size provided to CN nodes if the
storageVolume
configuration is not specified. Furthermore, is it possible to change the assigned disk size without assigning it a pvc?
r
Based on the StarRocks Kubernetes Operator and the provided example configuration, here is the information regarding CN (Compute Node) disk sizes: 1. Default Disk Size for CN Nodes If the
storageVolume
(or
storageVolumes
in the CRD) configuration is not specified for CN nodes, the StarRocks Operator does not create a Persistent Volume Claim (PVC). Instead, it defaults to using an
emptyDir
volume for the CN's storage (including logs and local cache). * Default Size: The size of an
emptyDir
volume is not fixed by the operator. It is limited by the available space on the Kubernetes node's disk (specifically the filesystem where the kubelet's root directory, typically
/var/lib/kubelet
, is located). * Behavior: Because CN nodes are designed to be "stateless" or use storage primarily for query caching, the
emptyDir
allows them to scale up and down quickly without managing persistent state. 2. Changing Disk Size Without a PVC Yes, it is possible to change or limit the assigned disk size for CN nodes without using a persistent PVC (i.e., without persistent storage that survives pod deletion). You can do this in two ways: * Using
emptyDir
with a `sizeLimit`:
While the StarRocks Operator primarily focuses on PVC-based
storageVolumes
, you can sometimes influence this through the
storageVolumes
configuration by specifying a storage class that provides ephemeral local storage. However, the most direct way in Kubernetes is to set a
sizeLimit
on the
emptyDir
. In the
StarRocksCluster
CRD, you can define
storageVolumes
but omit the
storageClassName
(which would use the default) or use a specific "ephemeral" storage class if your cluster supports one. * Resource Limits (Ephemeral Storage): You can control the amount of disk space a CN pod can consume by specifying
ephemeral-storage
requests and limits in the
resources
section of the `starRocksCnSpec`:
Copy code
yaml
    starRocksCnSpec:
      resources:
        requests:
          ephemeral-storage: "20Gi"
        limits:
          ephemeral-storage: "50Gi"
This ensures the CN node has a guaranteed amount of local disk space and is prevented from consuming more than the specified limit on the host node, effectively "assigning" a disk size without a dedicated PVC. Summary * Default: Node-dependent (uses
emptyDir
). * Adjustment: Use
resources.limits.ephemeral-storage
to set a cap without using a PVC. Referencesdeployment/sr_operator.mdquick_start/helm.mdadministration/management/FE_configuration.md
🙌 1