Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ package config

import "fmt"

var DNSDomainSuffix string
var (
// DNSDomainSuffix is the suffix of the dns domain in k8s
DNSDomainSuffix string

// VolumeNameWithHash decides whether adding a hash to the volume name
VolumeNameWithHash bool
)

func GetServiceDomainSuffix() string {
return fmt.Sprintf("svc.%s", DNSDomainSuffix)
}

var VolumeNameWithHash bool
66 changes: 66 additions & 0 deletions config/crd/bases/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,28 @@ spec:
description: (Optional) If specified, the pod's nodeSelector,displayName="Map
of nodeSelectors to match when scheduling pods on nodes"
type: object
persistentVolumeClaimRetentionPolicy:
description: |-
PersistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
The WhenScaled field is only supported for the CN component.
properties:
whenDeleted:
description: |-
WhenDeleted specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is deleted. The default policy
of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
`Delete` policy causes those PVCs to be deleted.
type: string
whenScaled:
description: |-
WhenScaled specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is scaled down. The default
policy of `Retain` causes PVCs to not be affected by a scaledown. The
`Delete` policy causes the associated PVCs for any excess pods above
the replica count to be deleted.
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -7632,6 +7654,28 @@ spec:
description: (Optional) If specified, the pod's nodeSelector,displayName="Map
of nodeSelectors to match when scheduling pods on nodes"
type: object
persistentVolumeClaimRetentionPolicy:
description: |-
PersistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
The WhenScaled field is only supported for the CN component.
properties:
whenDeleted:
description: |-
WhenDeleted specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is deleted. The default policy
of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
`Delete` policy causes those PVCs to be deleted.
type: string
whenScaled:
description: |-
WhenScaled specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is scaled down. The default
policy of `Retain` causes PVCs to not be affected by a scaledown. The
`Delete` policy causes the associated PVCs for any excess pods above
the replica count to be deleted.
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -13521,6 +13565,28 @@ spec:
description: (Optional) If specified, the pod's nodeSelector,displayName="Map
of nodeSelectors to match when scheduling pods on nodes"
type: object
persistentVolumeClaimRetentionPolicy:
description: |-
PersistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
The WhenScaled field is only supported for the CN component.
properties:
whenDeleted:
description: |-
WhenDeleted specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is deleted. The default policy
of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
`Delete` policy causes those PVCs to be deleted.
type: string
whenScaled:
description: |-
WhenScaled specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is scaled down. The default
policy of `Retain` causes PVCs to not be affected by a scaledown. The
`Delete` policy causes the associated PVCs for any excess pods above
the replica count to be deleted.
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down
22 changes: 22 additions & 0 deletions config/crd/bases/starrocks.com_starrockswarehouses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3225,6 +3225,28 @@ spec:
description: (Optional) If specified, the pod's nodeSelector,displayName="Map
of nodeSelectors to match when scheduling pods on nodes"
type: object
persistentVolumeClaimRetentionPolicy:
description: |-
PersistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
The WhenScaled field is only supported for the CN component.
properties:
whenDeleted:
description: |-
WhenDeleted specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is deleted. The default policy
of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
`Delete` policy causes those PVCs to be deleted.
type: string
whenScaled:
description: |-
WhenScaled specifies what happens to PVCs created from StatefulSet
VolumeClaimTemplates when the StatefulSet is scaled down. The default
policy of `Retain` causes PVCs to not be affected by a scaledown. The
`Delete` policy causes the associated PVCs for any excess pods above
the replica count to be deleted.
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down
21 changes: 21 additions & 0 deletions deploy/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,13 @@ spec:
additionalProperties:
type: string
type: object
persistentVolumeClaimRetentionPolicy:
properties:
whenDeleted:
type: string
whenScaled:
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -3658,6 +3665,13 @@ spec:
additionalProperties:
type: string
type: object
persistentVolumeClaimRetentionPolicy:
properties:
whenDeleted:
type: string
whenScaled:
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -6383,6 +6397,13 @@ spec:
additionalProperties:
type: string
type: object
persistentVolumeClaimRetentionPolicy:
properties:
whenDeleted:
type: string
whenScaled:
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down
7 changes: 7 additions & 0 deletions deploy/starrocks.com_starrockswarehouses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,13 @@ spec:
additionalProperties:
type: string
type: object
persistentVolumeClaimRetentionPolicy:
properties:
whenDeleted:
type: string
whenScaled:
type: string
type: object
podLabels:
additionalProperties:
type: string
Expand Down
27 changes: 13 additions & 14 deletions helm-charts/charts/kube-starrocks/charts/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@

global:
rbac:
# if set true, the clusterrole, clusterrolebinding, serviceaccount resources will be created for
# operator. If changed to false later, these resources will be deleted.
# If set true, the clusterrole, clusterrolebinding, serviceaccount resources will be created for
# the operator. If changed to false later, these resources will be deleted.
# Note: By default the operator will watch all namespaces, so it needs clusterrole, clusterrolebinding to access resources.
# If .Values.starrocksOperator.watchNamespace is set, the role and rolebinding will be created for the specified namespace.
create: true
serviceAccount:
name: "starrocks"
# Optional annotations to add to serviceaccount manifest
# Optional annotations to add to the serviceaccount manifest
annotations: {}
# Optional labels to add to serviceaccount manifest
# Optional labels to add to the serviceaccount manifest
labels: {}

# TimeZone is used to set the environment variable TZ for pod, with Asia/Shanghai as the default.
timeZone: Asia/Shanghai

# set the nameOverride values for creating the same resources with parent chart.
# Set the nameOverride values for creating the same resources with the parent chart.
# In version v1.7.1 or before, there is only one chart called kube-starrocks, and the chart name is the prefix
# of some resources created by the chart.
# In version v1.8.0, the kube-starrocks chart is split into two charts, and to keep backward compatibility, the
# nameOverride is used to set the prefix of the resources created by operator chart.
# nameOverride is used to set the prefix of the resources created by the operator chart.
nameOverride: "kube-starrocks"

starrocksOperator:
# If enabled, the operator releated resources will be created, including the operator deployment, service account,
# If enabled, the operator-related resources will be created, including the operator deployment, service account,
# clusterrole, clusterrolebinding, and service account.
enabled: true
# annotations for starrocks operator.
Expand All @@ -47,7 +47,7 @@ starrocksOperator:
cpu: 500m
memory: 400Mi
# By default, the operator will only set runAsNonRoot to true, allowPrivilegeEscalation to false, readOnlyRootFilesystem to true.
# You can customize the securityContext for operator pod, e.g. drop capabilities, seccompProfile, etc.
# You can customize the securityContext for operator pod, e.g., drop capabilities, seccompProfile, etc.
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -80,9 +80,9 @@ starrocksOperator:
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
# If specified, it will restrict operator to watch resources in the specified namespace. And
# 1. You must deploy your StarRocks cluster to the specified namespace.
# 2. You can not assign multiple namespaces to watchNamespace field.
# 2. You cannot assign multiple namespaces to watchNamespace field.
# Note: In most cases, you should not set this value. If your kubernetes cluster manages too many nodes, and
# operator watching all namespaces use too many memory resources, you can set this value.
# the operator watching all namespaces uses too many memory resources, you can set this value.
# Defaults to all namespaces.
watchNamespace: ""
# Additional operator container environment variables
Expand All @@ -97,12 +97,11 @@ starrocksOperator:
- --zap-encoder=console
# if you want open debug log, open this option
# - --zap-log-level 4
# Operator need to specify the FQDN in nginx.conf when it set up fe-proxy service.
# Operator needs to specify the FQDN in nginx.conf when it set up fe-proxy service.
# By default, Operator will use cluster.local as the dnsDomainSuffix.
# If you set up a kubernetes cluster with a different dnsDomainSuffix, you need to set this value.
dnsDomainSuffix: ""
# By default, the volume name of secret and configmap created by operator for the FE/BE/CN pods has a hash suffix.
# If users plan to use a sidecar or init container to mount the same volume, it will be difficult to get the volume name.
# If users plan to use a sidecar or init container to mount the same volume, it will be challenging to get the volume name.
# In this situation, you can set this value to false.
volumeNameWithHash: true

volumeNameWithHash: true
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ spec:
{{- end }}
{{- end }}
{{- end }}

{{- if .Values.starrocksFESpec.persistentVolumeClaimRetentionPolicy }}
persistentVolumeClaimRetentionPolicy:
{{- toYaml .Values.starrocksFESpec.persistentVolumeClaimRetentionPolicy | nindent 6 }}
{{- end }}
{{- if .Values.starrocksCluster.enabledBe }}
starRocksBeSpec:
{{- if .Values.starrocksBeSpec.initContainers }}
Expand Down Expand Up @@ -573,6 +576,10 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.starrocksBeSpec.persistentVolumeClaimRetentionPolicy }}
persistentVolumeClaimRetentionPolicy:
{{- toYaml .Values.starrocksBeSpec.persistentVolumeClaimRetentionPolicy | nindent 6 }}
{{- end }}
{{- end }}
{{- if .Values.starrocksCluster.enabledCn }}
starRocksCnSpec:
Expand Down Expand Up @@ -875,6 +882,10 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.starrocksCnSpec.persistentVolumeClaimRetentionPolicy }}
persistentVolumeClaimRetentionPolicy:
{{- toYaml .Values.starrocksCnSpec.persistentVolumeClaimRetentionPolicy | nindent 6 }}
{{- end }}
{{- end }}

{{- if .Values.starrocksFeProxySpec.enabled }}
Expand Down
16 changes: 16 additions & 0 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ starrocksFESpec:
# path: /tmp
# type: Directory
# mountPath: /tmp
# persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
# The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
# The WhenScaled field is only supported for the CN component.
persistentVolumeClaimRetentionPolicy:
# whenDeleted: Delete
# the config for start fe. the base information as follows.
config: |
LOG_DIR = ${STARROCKS_HOME}/log
Expand Down Expand Up @@ -737,6 +742,12 @@ starrocksCnSpec:
# path: /tmp
# type: Directory
# mountPath: /tmp
# persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
# The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
# The WhenScaled field is only supported for the CN component.
persistentVolumeClaimRetentionPolicy:
# whenDeleted: Delete
# whenScaled: Delete
# the config start for cn, the base information as follows.
# From StarRocks 3.1, the official documentation uses:
# 1. be_port instead of thrift_port, but the thrift_port is still supported.
Expand Down Expand Up @@ -1052,6 +1063,11 @@ starrocksBeSpec:
# path: /tmp
# type: Directory
# mountPath: /tmp
# persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
# The WhenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
# The WhenScaled field is only supported for the CN component.
persistentVolumeClaimRetentionPolicy:
# whenDeleted: Delete
# the config for start be. The base information is as follows.
# From StarRocks 3.1, the official documentation uses:
# 1. be_http_port instead of webserver_port, but the webserver_port is still supported.
Expand Down
Loading