-
Notifications
You must be signed in to change notification settings - Fork 69
/
deploy_a_starrocks_cluster_with_cn.yaml
112 lines (111 loc) · 5.61 KB
/
deploy_a_starrocks_cluster_with_cn.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# This manifest deploys a StarRocks cluster with 3 FEs, 3 BEs, and CN with autoscaling enabled.
# CN nodes are optional components of StarRocks.
# You can increase the number of CN nodes to elastically scale compute resources without
# changing the data distribution in your StarRocks cluster.
apiVersion: starrocks.com/v1
kind: StarRocksCluster
metadata:
name: a-starrocks-with-cn # change the name if needed.
spec:
starRocksFeSpec:
image: starrocks/fe-ubuntu:latest
replicas: 3
# If you just want to start a running StarRocks cluster, you can set a smaller request/limit, such as 1 core and 2GB.
# See https://docs.starrocks.io/docs/deployment/plan_cluster/#cpu-and-memory for more information about how to configure CPU and memory in production.
limits:
cpu: 4
memory: 8Gi
requests:
cpu: 4
memory: 8Gi
# storageVolumes is optional. If you don't specify it, emptyDir will be used to store FE meta and log, and the files
# and directories written to the volume will be completely lost upon container restarting.
storageVolumes:
- name: fe-storage-meta
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
# FE container stop running if the disk free space which the fe meta directory residents, is less than 5Gi.
storageSize: 10Gi
mountPath: /opt/starrocks/fe/meta
- name: fe-storage-log
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
storageSize: 5Gi
mountPath: /opt/starrocks/fe/log
starRocksBeSpec:
image: starrocks/be-ubuntu:latest
replicas: 3
# If you just want to start a running StarRocks cluster, you can set a smaller request/limit, such as 1 core and 2GB.
# See https://docs.starrocks.io/docs/deployment/plan_cluster/#cpu-and-memory for more information about how to configure CPU and memory in production.
limits:
cpu: 4
memory: 8Gi
requests:
cpu: 4
memory: 8Gi
# storageVolumes is optional. If you don't specify it, emptyDir will be used to store BE data and log, and be aware
# that the files and directories written to the volume will be completely lost upon container restarting.
storageVolumes:
- name: be-storage-data
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
storageSize: 1Ti
mountPath: /opt/starrocks/be/storage
- name: be-storage-log
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
storageSize: 1Gi
mountPath: /opt/starrocks/be/log
starRocksCnSpec:
image: starrocks/cn-ubuntu:latest
# If you just want to start a running StarRocks cluster, you can set a smaller request/limit, such as 1 core and 2GB.
# See https://docs.starrocks.io/docs/deployment/plan_cluster/#cpu-and-memory for more information about how to configure CPU and memory in production.
limits:
cpu: 4
memory: 8Gi
requests:
cpu: 4
memory: 8Gi
# storageVolumes is optional. If you don't specify it, emptyDir will be used to store CN cache data and log, and be aware
# that the files and directories written to the volume will be completely lost upon container restarting.
storageVolumes:
- name: cn-cache-data
storageClassName: "hostPath" # If storageClassName is not set, Kubernetes will use the default storage class.
hostPath:
path: /storage
storageSize: 1Ti
mountPath: /opt/starrocks/cn/storage
- name: cn-log
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
storageSize: 1Gi
mountPath: /opt/starrocks/cn/log
# autoScalingPolicy is optional. If you don't specify it, the CN nodes will not be auto-scaled.
autoScalingPolicy: # Automatic scaling policy of the CN cluster.
maxReplicas: 10 # The maximum number of CNs is set to 10.
minReplicas: 1 # The minimum number of CNs is set to 1.
# operator creates an HPA resource based on the following field.
# see https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ for more information.
hpaPolicy:
metrics: # Resource metrics
- type: Resource
resource:
name: memory # The average memory usage of CNs is specified as a resource metric.
target:
# The elastic scaling threshold is 60%.
# When the average memory utilization of CNs exceeds 60%, the number of CNs increases for scale-out.
# When the average memory utilization of CNs is below 60%, the number of CNs decreases for scale-in.
averageUtilization: 60
type: Utilization
- type: Resource
resource:
name: cpu # The average CPU utilization of CNs is specified as a resource metric.
target:
# The elastic scaling threshold is 60%.
# When the average CPU utilization of CNs exceeds 60%, the number of CNs increases for scale-out.
# When the average CPU utilization of CNs is below 60%, the number of CNs decreases for scale-in.
averageUtilization: 60
type: Utilization
behavior: # The scaling behavior is customized according to business scenarios, helping you achieve rapid or slow scaling or disable scaling.
scaleUp:
policies:
- type: Pods
value: 1
periodSeconds: 10
scaleDown:
selectPolicy: Disabled