Skip to content

Commit

Permalink
review code
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <[email protected]>
  • Loading branch information
yandongxiao committed Nov 19, 2024
1 parent 39d3274 commit b7c6a38
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 173 deletions.
174 changes: 92 additions & 82 deletions doc/setup-starrocks-when-readOnlyRootFilesystem-is-true.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,55 +65,63 @@ metadata:
namespace: starrocks
spec:
starRocksFeSpec:
command: [ "bash", "-c" ]
args:
- cp -r /opt/starrocks/* /opt/starrocks-artifacts && export STARROCKS_ROOT=/opt/starrocks-artifacts && exec /opt/starrocks-artifacts/fe_entrypoint.sh $FE_SERVICE_NAME
readOnlyRootFilesystem: true
runAsNonRoot: true
configMapInfo:
configMapName: kube-starrocks-fe-cm
resolveKey: fe.conf
storageVolumes:
- mountPath: /opt/starrocks-artifacts
name: fe-artifacts
storageClassName: emptyDir
storageSize: 20Gi
- mountPath: /opt/starrocks-meta
name: fe-meta
storageSize: 10Gi
- mountPath: /opt/starrocks-log
name: fe-log
storageSize: 10Gi
command: ["bash", "-c"]
args:
- cp -r /opt/starrocks/* /opt/starrocks-artifacts && exec /opt/starrocks-artifacts/fe_entrypoint.sh $FE_SERVICE_NAME
feEnvVars:
- name: STARROCKS_ROOT
value: /opt/starrocks-artifacts
image: starrocks/fe-ubuntu:3.2.2
imagePullPolicy: IfNotPresent
replicas: 1
requests:
cpu: 1m
memory: 22Mi
storageVolumes:
- mountPath: /opt/starrocks-artifacts
name: fe-artifacts
storageClassName: emptyDir
storageSize: 20Gi
- mountPath: /opt/starrocks-meta
name: fe-meta
storageSize: 10Gi
- mountPath: /opt/starrocks-log
name: fe-log
storageSize: 10Gi
starRocksBeSpec:
command: [ "bash", "-c" ]
args:
- cp -r /opt/starrocks/* /opt/starrocks-artifacts && export STARROCKS_ROOT=/opt/starrocks-artifacts && exec /opt/starrocks-artifacts/be_entrypoint.sh $FE_SERVICE_NAME
readOnlyRootFilesystem: true
runAsNonRoot: true
configMapInfo:
configMapName: kube-starrocks-be-cm
resolveKey: be.conf
storageVolumes:
- mountPath: /opt/starrocks-artifacts
name: be-artifacts
storageClassName: emptyDir
storageSize: 20Gi
- mountPath: /opt/starrocks-storage
name: be-storage # the name must be this
storageSize: 10Gi
- mountPath: /opt/starrocks-log
name: be-log # the name must be this
storageSize: 10Gi
command: ["bash", "-c"]
args:
- cp -r /opt/starrocks/* /opt/starrocks-artifacts && exec /opt/starrocks-artifacts/be_entrypoint.sh $FE_SERVICE_NAME
beEnvVars:
- name: STARROCKS_ROOT
value: /opt/starrocks-artifacts
image: starrocks/be-ubuntu:3.2.2
imagePullPolicy: IfNotPresent
replicas: 1
replicas: 2
requests:
cpu: 1m
memory: 10Mi
storageVolumes:
- mountPath: /opt/starrocks-artifacts
name: be-artifacts
storageClassName: emptyDir
storageSize: 20Gi
- mountPath: /opt/starrocks-storage
name: be-storage # the name must be this
storageSize: 10Gi
- mountPath: /opt/starrocks-log
name: be-log # the name must be this
storageSize: 10Gi

---

Expand All @@ -129,7 +137,7 @@ data:
edit_log_port = 9010
mysql_service_nio_enabled = true
sys_log_level = INFO
# config for meta and log
meta_dir = /opt/starrocks-meta
dump_log_dir = /opt/starrocks-log
Expand Down Expand Up @@ -171,67 +179,34 @@ If you are using the `kube-starrocks` Helm chart, add the following snippets to
operator:
starrocksOperator:
image:
repository: operator
repository: starrocks/operator
tag: v1.9.9-rc1
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 1m
memory: 20Mi
starrocks:
initPassword:
enabled: false
password: "123456"
starrocksBeSpec:
starrocksFESpec:
readOnlyRootFilesystem: true
entrypoint:
script: |
#! /bin/bash
echo "do something before start BE"
cp -r /opt/starrocks/* /opt/starrocks-artifacts
export STARROCKS_ROOT=/opt/starrocks-artifacts
exec /opt/starrocks-artifacts/be_entrypoint.sh $FE_SERVICE_NAME
image:
repository: starrocks/be-ubuntu
tag: 3.2.2
replicas: 1
resources:
limits:
cpu: 8
memory: 8Gi
requests:
cpu: 1m
memory: 10Mi
runAsNonRoot: true
storageSpec:
name: be
name: fe
storageSize: 10Gi
storageMountPath: /opt/starrocks-storage
storageMountPath: /opt/starrocks-meta
logStorageSize: 10Gi
logMountPath: /opt/starrocks-log
spillStorageSize: 10Gi
spillMountPath: /opt/starrocks-spill
emptyDirs:
- name: be-artifacts
mountPath: /opt/starrocks-artifacts
config: |
be_port = 9060
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
sys_log_level = INFO
default_rowset_type = beta
# config for storage and log
storage_root_path = /opt/starrocks-storage
sys_log_dir = /opt/starrocks-log
spill_local_storage_dir = /opt/starrocks-spill
starrocksFESpec:
readOnlyRootFilesystem: true
- name: fe-artifacts
mountPath: /opt/starrocks-artifacts
entrypoint:
script: |
#! /bin/bash
cp -r /opt/starrocks/* /opt/starrocks-artifacts
export STARROCKS_ROOT=/opt/starrocks-artifacts
exec /opt/starrocks/fe_entrypoint.sh $FE_SERVICE_NAME
feEnvVars:
- name: STARROCKS_ROOT
value: /opt/starrocks-artifacts
image:
repository: starrocks/fe-ubuntu
tag: 3.2.2
Expand All @@ -242,15 +217,6 @@ starrocks:
requests:
cpu: 1m
memory: 20Mi
storageSpec:
name: fe
storageSize: 10Gi
storageMountPath: /opt/starrocks-meta
logStorageSize: 10Gi
logMountPath: /opt/starrocks-log
emptyDirs:
- name: fe-artifacts
mountPath: /opt/starrocks-artifacts
config: |
LOG_DIR = ${STARROCKS_HOME}/log
DATE = "$(date +%Y%m%d-%H%M%S)"
Expand All @@ -266,4 +232,48 @@ starrocks:
dump_log_dir = /opt/starrocks-log
sys_log_dir = /opt/starrocks-log
audit_log_dir = /opt/starrocks-log
starrocksBeSpec:
readOnlyRootFilesystem: true
runAsNonRoot: true
storageSpec:
name: be
storageSize: 10Gi
storageMountPath: /opt/starrocks-storage
logStorageSize: 10Gi
logMountPath: /opt/starrocks-log
spillStorageSize: 10Gi
spillMountPath: /opt/starrocks-spill
emptyDirs:
- name: be-artifacts
mountPath: /opt/starrocks-artifacts
entrypoint:
script: |
#! /bin/bash
cp -r /opt/starrocks/* /opt/starrocks-artifacts
exec /opt/starrocks-artifacts/be_entrypoint.sh $FE_SERVICE_NAME
beEnvVars:
- name: STARROCKS_ROOT
value: /opt/starrocks-artifacts
image:
repository: starrocks/be-ubuntu
tag: 3.2.2
replicas: 1
resources:
limits:
cpu: 8
memory: 8Gi
requests:
cpu: 1m
memory: 10Mi
config: |
be_port = 9060
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
sys_log_level = INFO
default_rowset_type = beta
# config for storage and log
storage_root_path = /opt/starrocks-storage
sys_log_dir = /opt/starrocks-log
spill_local_storage_dir = /opt/starrocks-spill
```
23 changes: 18 additions & 5 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,15 @@ starrocksFESpec:
storageSize: 10Gi
# If storageMountPath is empty, the storageMountPath will be set to /opt/starrocks/fe/meta.
storageMountPath: ""
logMountPath: ""
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/fe/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
logStorageSize: 5Gi
# If logMountPath is empty, the logMountPath will be set to /opt/starrocks/fe/log.
# If logMountPath is not /opt/starrocks/fe/log, you must add in config the following configuration:
# dump_log_dir = xxx
# sys_log_dir = xxx
# audit_log_dir = xxx
logMountPath: ""
# mount emptyDir volumes if necessary.
# Note: please use storageSpec field for persistent metadata and log.
emptyDirs: []
Expand Down Expand Up @@ -588,15 +593,19 @@ starrocksCnSpec:
storageCount: 1
# see the comment of storageCount for the usage of storageMountPath.
storageMountPath: ""
logMountPath: ""
spillMountPath: ""
# the storage size of persistent volume for log, and the mount path is /opt/starrocks/cn/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
logStorageSize: 20Gi
# If logMountPath is empty, the logMountPath will be set to /opt/starrocks/cn/log.
# If logMountPath is not /opt/starrocks/cn/log, you must add in config the following configuration: sys_log_dir = xxx.
logMountPath: ""
# Setting this parameter can persist spill storage, and the mount path is /opt/starrocks/cn/spill.
# If you set it to 0Gi, the related PVC will not be created, and the spill will not be persisted.
# You need to add in be.conf spill_local_storage_dir=/opt/starrocks/cn/spill.
spillStorageSize: 0Gi
# If spillMountPath is empty, the spillMountPath will be set to /opt/starrocks/cn/spill.
# If spillMountPath is not /opt/starrocks/cn/spill, you must add in config the following configuration: spill_local_storage_dir = xxx.
spillMountPath: ""
# mount emptyDir volumes if necessary.
# Note: please use storageSpec field for persistent storage data and log.
emptyDirs: []
Expand Down Expand Up @@ -868,15 +877,19 @@ starrocksBeSpec:
storageCount: 1
# see the comment of storageCount for the usage of storageMountPath.
storageMountPath: ""
logMountPath: ""
spillMountPath: ""
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
logStorageSize: 20Gi
# If logMountPath is empty, the logMountPath will be set to /opt/starrocks/be/log.
# If logMountPath is not /opt/starrocks/be/log, you must add in config the following configuration: sys_log_dir = xxx.
logMountPath: ""
# Setting this parameter can persist spill storage, and the mount path is /opt/starrocks/be/spill.
# If you set it to 0Gi, the related PVC will not be created, and the spill will not be persisted.
# You need to add in be.conf spill_local_storage_dir=/opt/starrocks/be/spill.
spillStorageSize: 0Gi
# If spillMountPath is empty, the spillMountPath will be set to /opt/starrocks/be/spill.
# If spillMountPath is not /opt/starrocks/be/spill, you must add in config the following configuration: spill_local_storage_dir = xxx.
spillMountPath: ""
# mount emptyDir volumes if necessary.
# Note: please use storageSpec field for persistent storage data and log.
emptyDirs: []
Expand Down
18 changes: 18 additions & 0 deletions helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ starrocks:
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/fe/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
logStorageSize: 5Gi
# If logMountPath is empty, the logMountPath will be set to /opt/starrocks/fe/log.
# If logMountPath is not /opt/starrocks/fe/log, you must add in config the following configuration:
# dump_log_dir = xxx
# sys_log_dir = xxx
# audit_log_dir = xxx
logMountPath: ""
# mount emptyDir volumes if necessary.
# Note: please use storageSpec field for persistent metadata and log.
emptyDirs: []
Expand Down Expand Up @@ -698,10 +704,16 @@ starrocks:
# the storage size of persistent volume for log, and the mount path is /opt/starrocks/cn/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
logStorageSize: 20Gi
# If logMountPath is empty, the logMountPath will be set to /opt/starrocks/cn/log.
# If logMountPath is not /opt/starrocks/cn/log, you must add in config the following configuration: sys_log_dir = xxx.
logMountPath: ""
# Setting this parameter can persist spill storage, and the mount path is /opt/starrocks/cn/spill.
# If you set it to 0Gi, the related PVC will not be created, and the spill will not be persisted.
# You need to add in be.conf spill_local_storage_dir=/opt/starrocks/cn/spill.
spillStorageSize: 0Gi
# If spillMountPath is empty, the spillMountPath will be set to /opt/starrocks/cn/spill.
# If spillMountPath is not /opt/starrocks/cn/spill, you must add in config the following configuration: spill_local_storage_dir = xxx.
spillMountPath: ""
# mount emptyDir volumes if necessary.
# Note: please use storageSpec field for persistent storage data and log.
emptyDirs: []
Expand Down Expand Up @@ -976,10 +988,16 @@ starrocks:
# Setting this parameter can persist log storage, and the mount path is /opt/starrocks/be/log.
# If you set it to 0Gi, the related PVC will not be created, and the log will not be persisted.
logStorageSize: 20Gi
# If logMountPath is empty, the logMountPath will be set to /opt/starrocks/be/log.
# If logMountPath is not /opt/starrocks/be/log, you must add in config the following configuration: sys_log_dir = xxx.
logMountPath: ""
# Setting this parameter can persist spill storage, and the mount path is /opt/starrocks/be/spill.
# If you set it to 0Gi, the related PVC will not be created, and the spill will not be persisted.
# You need to add in be.conf spill_local_storage_dir=/opt/starrocks/be/spill.
spillStorageSize: 0Gi
# If spillMountPath is empty, the spillMountPath will be set to /opt/starrocks/be/spill.
# If spillMountPath is not /opt/starrocks/be/spill, you must add in config the following configuration: spill_local_storage_dir = xxx.
spillMountPath: ""
# mount emptyDir volumes if necessary.
# Note: please use storageSpec field for persistent storage data and log.
emptyDirs: []
Expand Down
Loading

0 comments on commit b7c6a38

Please sign in to comment.