-
Notifications
You must be signed in to change notification settings - Fork 69
/
deploy_a_starrocks_cluster_with_all_features.yaml
500 lines (490 loc) · 20.1 KB
/
deploy_a_starrocks_cluster_with_all_features.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# This manifest deploys a StarRocks cluster with all supported features.
apiVersion: starrocks.com/v1
kind: StarRocksCluster
metadata:
name: a-starrocks-with-all-features # change the name if needed.
spec:
# the spec for starrocks FE.
starRocksFeSpec:
# the image for starrocks FE.
image: starrocks/fe-ubuntu:latest
# number of replicas for starrocks FE.
replicas: 3
# define resources requests and limits for FE pods.
limits:
cpu: 8
memory: 16Gi
requests:
cpu: 8
memory: 16Gi
# reference the configMap for FE which contains the fe.conf.
configMapInfo:
configMapName: starrockscluster-sample-fe-cm
resolveKey: fe.conf
# fe storage volumes for persistent metadata and log
storageVolumes:
- name: fe-storage-meta
# the storageClassName represent the used storageclass name. if not set will use k8s cluster default storageclass.
# storageClassName: ""
# the persistent volume size. FE container stop running if the disk free space which the
# fe meta directory residents, is less than 5Gi.
storageSize: 10Gi
# the mount path for FE meta.
mountPath: /opt/starrocks/fe/meta
- name: fe-storage-log
# storageClassName: ""
# the size of storage volume for log
storageSize: 1Gi
# the mount path for FE log.
mountPath: /opt/starrocks/fe/log
# add annotations for fe pods.
annotations: {}
# the pod labels for user select or classify pods.
podLabels: {}
# schedulerName allows you to specify which scheduler will be used for your pods.
schedulerName: ""
# affinity for fe pod scheduling.
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchFields:
# - key: metadata.name
# operator: In
# values:
# - target-host-name
# Node tolerations for fe pod scheduling to nodes with taints
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
# If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes"
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
nodeSelector: {}
# kubernetes.io/arch: amd64
# kubernetes.io/os: linux
# Additional fe container environment variables
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
feEnvVars: []
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
# e.g. secret environment variable:
# - name: USERNAME
# valueFrom:
# secretKeyRef:
# name: mysecret
# key: username
# If runAsNonRoot is true, the container is run as non-root user.
# The userId will be set to 1000, and the groupID will be set to 1000.
runAsNonRoot: false
service:
# the fe service type, only supported ClusterIP, NodePort, LoadBalancer
type: ClusterIP
# the loadBalancerIP for static ip config when the type=LoadBalancer
loadBalancerIP: ""
# add annotations for fe service.
annotations: {}
# config the service port for fe service.
# if you want to use a dedicated port for fe service, you can config the port.
# see https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports for more details.
ports: []
# e.g. use a dedicated node port for http port of fe service.
# - name: http # fill the name from the fe service ports
# nodePort: 30030 # The range of valid ports is 30000-32767
# imagePullSecrets allows you to use secrets to pull images for pods.
imagePullSecrets: []
# serviceAccount for fe access cloud service.
serviceAccount: ""
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
# e.g. mount my-secret to /etc/my-secret
# - name: my-secret
# mountPath: /etc/my-secret
# subPath: ""
# mount configmaps if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
configMaps: []
# e.g. mount my-configmap to /etc/my-configmap
# - name: my-configmap
# mountPath: /etc/my-configmap
# subPath: ""
# startupProbeFailureSeconds defines the total failure seconds of startupProbe.
# Default failureThreshold is 60 and the periodSeconds is 5, this means the startup
# will fail if the pod can't start in 300 seconds. Your StartupProbeFailureSeconds is
# the total time of seconds before startupProbe give up and fail the container start.
# If startupProbeFailureSeconds can't be divided by defaultPeriodSeconds, the failureThreshold
# will be rounded up
# Note: you can set it to 0 to disable the probe.
startupProbeFailureSeconds: 300
# LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
livenessProbeFailureSeconds: 15
# ReadinessProbeFailureSeconds defines the total failure seconds of readiness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
readinessProbeFailureSeconds: 15
# the spec for starrocks BE.
starRocksBeSpec: # the image for starrocks BE.
image: starrocks/be-ubuntu:latest
# number of replicas to deploy for a BE statefulset.
replicas: 3
# define resources requests and limits for BE pods.
limits:
cpu: 16
memory: 64Gi
requests:
cpu: 16
memory: 64Gi
# reference to the configmap for BE which contains the be.conf.
configMapInfo:
configMapName: starrockscluster-sample-be-cm
resolveKey: be.conf
# be storage volumes for persistent storage.
storageVolumes:
- name: be-storage-data
# the storageClassName represent the used storageclass name. if not set will use k8s cluster default storageclass.
# storageClassName: ""
# the size of storage volume for data
storageSize: 10Gi
# the mount path for BE data.
mountPath: /opt/starrocks/be/storage
- name: be-storage-log
# storageClassName: ""
# the size of storage volume for log
storageSize: 1Gi
# the mount path for BE log.
mountPath: /opt/starrocks/be/log
# add annotations for be pods.
annotations: {}
# the pod labels for user select or classify pods.
podLabels: {}
# schedulerName allows you to specify which scheduler will be used for your pods.
schedulerName: ""
# affinity for be pod scheduling.
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchFields:
# - key: metadata.name
# operator: In
# values:
# - target-host-name
# Node tolerations for be pod scheduling to nodes with taints
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
# If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes"
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
nodeSelector: {}
# kubernetes.io/arch: amd64
# kubernetes.io/os: linux
# Additional be container environment variables
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
beEnvVars: []
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
# e.g. secret environment variable:
# - name: USERNAME
# valueFrom:
# secretKeyRef:
# name: mysecret
# key: username
# If runAsNonRoot is true, the container is run as non-root user.
# The userId will be set to 1000, and the groupID will be set to 1000.
runAsNonRoot: false
service:
# the be service type, only supported ClusterIP, NodePort, LoadBalancer
type: ClusterIP
# the loadBalancerIP for static ip config when the type=LoadBalancer
loadBalancerIP: ""
# add annotations for be service.
annotations: {}
# config the service port for be service.
# if you want to use a dedicated port for be service, you can config the port.
# see https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports for more details.
ports: []
# e.g. use a dedicated node port for be service.
# - name: webserver # fill the name from the be service ports
# nodePort: 30040 # The range of valid ports is 30000-32767
# imagePullSecrets allows you to use secrets to pull images for pods.
imagePullSecrets: []
# serviceAccount for be access cloud service.
serviceAccount: ""
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
# e.g. mount my-secret to /etc/my-secret
# - name: my-secret
# mountPath: /etc/my-secret
# subPath: ""
# mount configmaps if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
configMaps: []
# e.g. mount my-configmap to /etc/my-configmap
# - name: my-configmap
# mountPath: /etc/my-configmap
# subPath: ""
# startupProbeFailureSeconds defines the total failure seconds of startupProbe.
# Default failureThreshold is 60 and the periodSeconds is 5, this means the startup
# will fail if the pod can't start in 300 seconds. Your StartupProbeFailureSeconds is
# the total time of seconds before startupProbe give up and fail the container start.
# If startupProbeFailureSeconds can't be divided by defaultPeriodSeconds, the failureThreshold
# will be rounded up
# Note: you can set it to 0 to disable the probe.
startupProbeFailureSeconds: 300
# LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
livenessProbeFailureSeconds: 15
# ReadinessProbeFailureSeconds defines the total failure seconds of readiness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
readinessProbeFailureSeconds: 15
# the spec for starrocks CN.
starRocksCnSpec: # the image for starrocks CN.
image: starrocks/cn-ubuntu:latest
# number of replicas to deploy for a CN statefulset.
# comment out this line if autoScalingPolicy is enabled.
# replicas: 1
# define resources requests and limits for CN pods.
limits:
cpu: 16
memory: 64Gi
requests:
cpu: 16
memory: 64Gi
# reference to the configmap for CN which contains the cn.conf.
configMapInfo:
configMapName: starrockscluster-sample-cn-cm
resolveKey: cn.conf
storageVolumes:
- name: cn-storage-data
# the storageClassName represent the used storageclass name. if not set will use k8s cluster default storageclass.
# storageClassName: ""
# the size of storage volume for data
storageSize: 10Gi
# the mount path of CN data
mountPath: /opt/starrocks/cn/storage
- name: cn-storage-log
# storageClassName: ""
# the size of storage volume for log
storageSize: 1Gi
# the mount path of CN log
mountPath: /opt/starrocks/cn/log
# comment out this section if you don't want to enable autoscaling policy.
autoScalingPolicy:
# the max replicas for CN autoscaling.
maxReplicas: 10
# the min replicas for CN autoscaling.
minReplicas: 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:
- type: Resource
resource:
# The average memory usage of CNs is specified as a resource metric.
name: memory
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:
# The average CPU utilization of CNs is specified as a resource metric.
name: cpu
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
# The scaling behavior is customized according to business scenarios, helping
# you achieve rapid or slow scaling or disable scaling.
behavior:
scaleUp:
policies:
- type: Pods
value: 1
periodSeconds: 10
scaleDown:
selectPolicy: Disabled
# add annotations for cn pods.
annotations: {}
# the pod labels for user select or classify pods.
podLabels: {}
# schedulerName allows you to specify which scheduler will be used for your pods.
schedulerName: ""
# Additional cn container environment variables
# Ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# affinity for cn pod scheduling.
affinity: {}
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchFields:
# - key: metadata.name
# operator: In
# values:
# - target-host-name
# Node tolerations for cn pod scheduling to nodes with taints
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
tolerations: []
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
# If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes"
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
nodeSelector: {}
# kubernetes.io/arch: amd64
# kubernetes.io/os: linux
cnEnvVars: []
# e.g. static environment variable:
# - name: DEMO_GREETING
# value: "Hello from the environment"
# e.g. secret environment variable:
# - name: USERNAME
# valueFrom:
# secretKeyRef:
# name: mysecret
# key: username
# If runAsNonRoot is true, the container is run as non-root user.
# The userId will be set to 1000, and the groupID will be set to 1000.
runAsNonRoot: false
service:
# the cn service type, only supported ClusterIP, NodePort, LoadBalancer
type: ClusterIP
# the loadBalancerIP for static ip config when the type=LoadBalancer
loadBalancerIP: ""
# add annotations for cn service.
annotations: {}
# config the service port for cn service.
# if you want to use a dedicated port for cn service, you can config the port.
# see https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports for more details.
ports: []
# e.g. use a dedicated node port for cn service.
# - name: webserver # fill the name from the cn service ports
# nodePort: 30040 # The range of valid ports is 30000-32767
# imagePullSecrets allows you to use secrets to pull images for pods.
imagePullSecrets: []
# serviceAccount for cn access cloud service.
serviceAccount: ""
# mount secrets if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
secrets: []
# e.g. mount my-secret to /etc/my-secret
# - name: my-secret
# mountPath: /etc/my-secret
# subPath: ""
# mount configmaps if necessary.
# see https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath for more details about subPath.
configMaps: []
# e.g. mount my-configmap to /etc/my-configmap
# - name: my-configmap
# mountPath: /etc/my-configmap
# subPath: ""
# startupProbeFailureSeconds defines the total failure seconds of startupProbe.
# Default failureThreshold is 60 and the periodSeconds is 5, this means the startup
# will fail if the pod can't start in 300 seconds. Your StartupProbeFailureSeconds is
# the total time of seconds before startupProbe give up and fail the container start.
# If startupProbeFailureSeconds can't be divided by defaultPeriodSeconds, the failureThreshold
# will be rounded up
# Note: you can set it to 0 to disable the probe.
startupProbeFailureSeconds: 300
# LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
livenessProbeFailureSeconds: 15
# ReadinessProbeFailureSeconds defines the total failure seconds of readiness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
readinessProbeFailureSeconds: 15
# the spec for starrocks FE proxy.
starRocksFeProxySpec:
replicas: 1
# define resources requests and limits for FE proxy pods.
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
service:
type: NodePort # export fe proxy service
ports:
- name: http-port # the name is from fe proxy service ports
nodePort: 30180 # The range of valid ports is 30000-32767
# set the resolver for nginx server, default kube-dns.kube-system.svc.cluster.local
resolver: "kube-dns.kube-system.svc.cluster.local"
# LivenessProbeFailureSeconds defines the total failure seconds of liveness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
livenessProbeFailureSeconds: 15
# ReadinessProbeFailureSeconds defines the total failure seconds of readiness Probe.
# default value is 15 seconds
# You can set it to 0 to disable the probe.
readinessProbeFailureSeconds: 15
---
# fe config
apiVersion: v1
kind: ConfigMap
metadata:
name: starrockscluster-sample-fe-cm
labels:
cluster: starrockscluster-sample
data:
fe.conf: |
LOG_DIR = ${STARROCKS_HOME}/log
DATE = "$(date +%Y%m%d-%H%M%S)"
JAVA_OPTS="-Dlog4j2.formatMsgNoLookups=true -Xmx8192m -XX:+UseG1GC -Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time"
http_port = 8030
rpc_port = 9020
query_port = 9030
edit_log_port = 9010
mysql_service_nio_enabled = true
sys_log_level = INFO
---
# be config
apiVersion: v1
kind: ConfigMap
metadata:
name: starrockscluster-sample-be-cm
labels:
cluster: starrockscluster-sample
data:
be.conf: |
be_port = 9060
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060
sys_log_level = INFO
default_rowset_type = beta
---
# cn config
apiVersion: v1
kind: ConfigMap
metadata:
name: starrockscluster-sample-cn-cm
labels:
cluster: starrockscluster-sample
data:
cn.conf: |
sys_log_level = INFO
# ports for admin, web, heartbeat service
thrift_port = 9060
webserver_port = 8040
heartbeat_service_port = 9050
brpc_port = 8060