Skip to content

Commit 0c8aefb

Browse files
authored
[Enhancement] Support Update Strategy for FE/BE/CN component (#594)
Signed-off-by: yandongxiao <[email protected]>
1 parent 062b180 commit 0c8aefb

File tree

17 files changed

+473
-11
lines changed

17 files changed

+473
-11
lines changed

config/crd/bases/starrocks.com_starrocksclusters.yaml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,6 +4362,47 @@ spec:
43624362
- whenUnsatisfiable
43634363
type: object
43644364
type: array
4365+
updateStrategy:
4366+
description: |-
4367+
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
4368+
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
4369+
employed to update Pods in the StatefulSet when a revision is made to
4370+
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
4371+
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
4372+
MaxUnavailableStatefulSet feature gate enabled.
4373+
properties:
4374+
rollingUpdate:
4375+
description: RollingUpdate is used to communicate parameters
4376+
when Type is RollingUpdateStatefulSetStrategyType.
4377+
properties:
4378+
maxUnavailable:
4379+
anyOf:
4380+
- type: integer
4381+
- type: string
4382+
description: |-
4383+
The maximum number of pods that can be unavailable during the update.
4384+
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
4385+
Absolute number is calculated from percentage by rounding up. This can not be 0.
4386+
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
4387+
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
4388+
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
4389+
will be counted towards MaxUnavailable.
4390+
x-kubernetes-int-or-string: true
4391+
partition:
4392+
description: |-
4393+
Partition indicates the ordinal at which the StatefulSet should be partitioned
4394+
for updates. During a rolling update, all pods from ordinal Replicas-1 to
4395+
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
4396+
This is helpful in being able to do a canary based deployment. The default value is 0.
4397+
format: int32
4398+
type: integer
4399+
type: object
4400+
type:
4401+
description: |-
4402+
Type indicates the type of the StatefulSetUpdateStrategy.
4403+
Default is RollingUpdate.
4404+
type: string
4405+
type: object
43654406
type: object
43664407
starRocksCnSpec:
43674408
description: StarRocksCnSpec define cn configuration for start cn
@@ -9283,6 +9324,47 @@ spec:
92839324
- whenUnsatisfiable
92849325
type: object
92859326
type: array
9327+
updateStrategy:
9328+
description: |-
9329+
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
9330+
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
9331+
employed to update Pods in the StatefulSet when a revision is made to
9332+
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
9333+
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
9334+
MaxUnavailableStatefulSet feature gate enabled.
9335+
properties:
9336+
rollingUpdate:
9337+
description: RollingUpdate is used to communicate parameters
9338+
when Type is RollingUpdateStatefulSetStrategyType.
9339+
properties:
9340+
maxUnavailable:
9341+
anyOf:
9342+
- type: integer
9343+
- type: string
9344+
description: |-
9345+
The maximum number of pods that can be unavailable during the update.
9346+
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
9347+
Absolute number is calculated from percentage by rounding up. This can not be 0.
9348+
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
9349+
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
9350+
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
9351+
will be counted towards MaxUnavailable.
9352+
x-kubernetes-int-or-string: true
9353+
partition:
9354+
description: |-
9355+
Partition indicates the ordinal at which the StatefulSet should be partitioned
9356+
for updates. During a rolling update, all pods from ordinal Replicas-1 to
9357+
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
9358+
This is helpful in being able to do a canary based deployment. The default value is 0.
9359+
format: int32
9360+
type: integer
9361+
type: object
9362+
type:
9363+
description: |-
9364+
Type indicates the type of the StatefulSetUpdateStrategy.
9365+
Default is RollingUpdate.
9366+
type: string
9367+
type: object
92869368
type: object
92879369
starRocksFeProxySpec:
92889370
description: StarRocksLoadSpec define a proxy for fe.
@@ -15074,6 +15156,47 @@ spec:
1507415156
- whenUnsatisfiable
1507515157
type: object
1507615158
type: array
15159+
updateStrategy:
15160+
description: |-
15161+
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
15162+
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
15163+
employed to update Pods in the StatefulSet when a revision is made to
15164+
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
15165+
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
15166+
MaxUnavailableStatefulSet feature gate enabled.
15167+
properties:
15168+
rollingUpdate:
15169+
description: RollingUpdate is used to communicate parameters
15170+
when Type is RollingUpdateStatefulSetStrategyType.
15171+
properties:
15172+
maxUnavailable:
15173+
anyOf:
15174+
- type: integer
15175+
- type: string
15176+
description: |-
15177+
The maximum number of pods that can be unavailable during the update.
15178+
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
15179+
Absolute number is calculated from percentage by rounding up. This can not be 0.
15180+
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
15181+
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
15182+
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
15183+
will be counted towards MaxUnavailable.
15184+
x-kubernetes-int-or-string: true
15185+
partition:
15186+
description: |-
15187+
Partition indicates the ordinal at which the StatefulSet should be partitioned
15188+
for updates. During a rolling update, all pods from ordinal Replicas-1 to
15189+
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
15190+
This is helpful in being able to do a canary based deployment. The default value is 0.
15191+
format: int32
15192+
type: integer
15193+
type: object
15194+
type:
15195+
description: |-
15196+
Type indicates the type of the StatefulSetUpdateStrategy.
15197+
Default is RollingUpdate.
15198+
type: string
15199+
type: object
1507715200
type: object
1507815201
type: object
1507915202
status:

config/crd/bases/starrocks.com_starrockswarehouses.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4973,6 +4973,47 @@ spec:
49734973
- whenUnsatisfiable
49744974
type: object
49754975
type: array
4976+
updateStrategy:
4977+
description: |-
4978+
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
4979+
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
4980+
employed to update Pods in the StatefulSet when a revision is made to
4981+
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
4982+
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
4983+
MaxUnavailableStatefulSet feature gate enabled.
4984+
properties:
4985+
rollingUpdate:
4986+
description: RollingUpdate is used to communicate parameters
4987+
when Type is RollingUpdateStatefulSetStrategyType.
4988+
properties:
4989+
maxUnavailable:
4990+
anyOf:
4991+
- type: integer
4992+
- type: string
4993+
description: |-
4994+
The maximum number of pods that can be unavailable during the update.
4995+
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
4996+
Absolute number is calculated from percentage by rounding up. This can not be 0.
4997+
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
4998+
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
4999+
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
5000+
will be counted towards MaxUnavailable.
5001+
x-kubernetes-int-or-string: true
5002+
partition:
5003+
description: |-
5004+
Partition indicates the ordinal at which the StatefulSet should be partitioned
5005+
for updates. During a rolling update, all pods from ordinal Replicas-1 to
5006+
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
5007+
This is helpful in being able to do a canary based deployment. The default value is 0.
5008+
format: int32
5009+
type: integer
5010+
type: object
5011+
type:
5012+
description: |-
5013+
Type indicates the type of the StatefulSetUpdateStrategy.
5014+
Default is RollingUpdate.
5015+
type: string
5016+
type: object
49765017
type: object
49775018
required:
49785019
- starRocksCluster

deploy/starrocks.com_starrocksclusters.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,22 @@ spec:
20522052
- whenUnsatisfiable
20532053
type: object
20542054
type: array
2055+
updateStrategy:
2056+
properties:
2057+
rollingUpdate:
2058+
properties:
2059+
maxUnavailable:
2060+
anyOf:
2061+
- type: integer
2062+
- type: string
2063+
x-kubernetes-int-or-string: true
2064+
partition:
2065+
format: int32
2066+
type: integer
2067+
type: object
2068+
type:
2069+
type: string
2070+
type: object
20552071
type: object
20562072
starRocksCnSpec:
20572073
properties:
@@ -4389,6 +4405,22 @@ spec:
43894405
- whenUnsatisfiable
43904406
type: object
43914407
type: array
4408+
updateStrategy:
4409+
properties:
4410+
rollingUpdate:
4411+
properties:
4412+
maxUnavailable:
4413+
anyOf:
4414+
- type: integer
4415+
- type: string
4416+
x-kubernetes-int-or-string: true
4417+
partition:
4418+
format: int32
4419+
type: integer
4420+
type: object
4421+
type:
4422+
type: string
4423+
type: object
43924424
type: object
43934425
starRocksFeProxySpec:
43944426
properties:
@@ -7072,6 +7104,22 @@ spec:
70727104
- whenUnsatisfiable
70737105
type: object
70747106
type: array
7107+
updateStrategy:
7108+
properties:
7109+
rollingUpdate:
7110+
properties:
7111+
maxUnavailable:
7112+
anyOf:
7113+
- type: integer
7114+
- type: string
7115+
x-kubernetes-int-or-string: true
7116+
partition:
7117+
format: int32
7118+
type: integer
7119+
type: object
7120+
type:
7121+
type: string
7122+
type: object
70757123
type: object
70767124
type: object
70777125
status:

deploy/starrocks.com_starrockswarehouses.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,6 +2374,22 @@ spec:
23742374
- whenUnsatisfiable
23752375
type: object
23762376
type: array
2377+
updateStrategy:
2378+
properties:
2379+
rollingUpdate:
2380+
properties:
2381+
maxUnavailable:
2382+
anyOf:
2383+
- type: integer
2384+
- type: string
2385+
x-kubernetes-int-or-string: true
2386+
partition:
2387+
format: int32
2388+
type: integer
2389+
type: object
2390+
type:
2391+
type: string
2392+
type: object
23772393
type: object
23782394
required:
23792395
- starRocksCluster

helm-charts/charts/kube-starrocks/charts/starrocks/templates/starrockscluster.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ spec:
2424
{{- end }}
2525
replicas: {{ .Values.starrocksFESpec.replicas }}
2626
imagePullPolicy: {{ .Values.starrocksFESpec.imagePullPolicy }}
27+
{{- if .Values.starrocksFESpec.maxUnavailablePods }}
28+
updateStrategy:
29+
rollingUpdate:
30+
maxUnavailable: "{{ .Values.starrocksFESpec.maxUnavailablePods }}"
31+
{{- end }}
2732
{{- /*
2833
support both resources and resource for backward compatibility
2934
*/}}
@@ -252,6 +257,11 @@ spec:
252257
{{- end }}
253258
replicas: {{ .Values.starrocksBeSpec.replicas }}
254259
imagePullPolicy: {{ .Values.starrocksBeSpec.imagePullPolicy }}
260+
{{- if .Values.starrocksBeSpec.maxUnavailablePods }}
261+
updateStrategy:
262+
rollingUpdate:
263+
maxUnavailable: "{{ .Values.starrocksBeSpec.maxUnavailablePods }}"
264+
{{- end }}
255265
{{- /*
256266
support both resources and resource for backward compatibility
257267
*/}}
@@ -512,6 +522,11 @@ spec:
512522
replicas: {{ .Values.starrocksCnSpec.replicas }}
513523
{{- end }}
514524
imagePullPolicy: {{ .Values.starrocksCnSpec.imagePullPolicy }}
525+
{{- if .Values.starrocksCnSpec.maxUnavailablePods }}
526+
updateStrategy:
527+
rollingUpdate:
528+
maxUnavailable: "{{ .Values.starrocksCnSpec.maxUnavailablePods }}"
529+
{{- end }}
515530
{{- if or .Values.starrocksCnSpec.serviceAccount .Values.starrocksCluster.componentValues.serviceAccount }}
516531
serviceAccount: {{ include "starrockscluster.cn.serviceAccount" . }}
517532
{{- end }}

helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,13 @@ starrocksFESpec:
382382
# volumeMounts:
383383
# - mountPath: /opt/starrocks/fe/meta
384384
# name: fe-meta # append -meta to the end of the name of the starrocksFESpec.storageSpec.name
385+
# Max unavailable pods for the fe component when doing rolling update.
386+
# This field cannot be 0. The default setting is 1.
387+
# Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored
388+
# only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled.
389+
# See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details.
390+
maxUnavailablePods:
391+
385392

386393
# spec for compute node, compute node provide compute function.
387394
starrocksCnSpec:
@@ -683,6 +690,12 @@ starrocksCnSpec:
683690
# volumeMounts:
684691
# - mountPath: /opt/starrocks/cn/storage
685692
# name: cn-data # append -data to the end of the name of the starrocksCnSpec.storageSpec.name
693+
# Max unavailable pods for the fe component when doing rolling update.
694+
# This field cannot be 0. The default setting is 1.
695+
# Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored
696+
# only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled.
697+
# See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details.
698+
maxUnavailablePods:
686699

687700
# spec for component be, provide storage and compute function.
688701
starrocksBeSpec:
@@ -946,6 +959,12 @@ starrocksBeSpec:
946959
# volumeMounts:
947960
# - mountPath: /opt/starrocks/be/storage
948961
# name: be-data # append -data to the end of the name of the starrocksBeSpec.storageSpec.name
962+
# Max unavailable pods for the fe component when doing rolling update.
963+
# This field cannot be 0. The default setting is 1.
964+
# Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored
965+
# only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled.
966+
# See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details.
967+
maxUnavailablePods:
949968

950969
# create secrets if necessary.
951970
secrets: []

0 commit comments

Comments
 (0)