Skip to content

Commit

Permalink
[Enhancement] Support Update Strategy for FE/BE/CN component (#594)
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <yandongxiao@starrocks.com>
  • Loading branch information
yandongxiao authored Nov 12, 2024
1 parent 062b180 commit 0c8aefb
Show file tree
Hide file tree
Showing 17 changed files with 473 additions and 11 deletions.
123 changes: 123 additions & 0 deletions config/crd/bases/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4362,6 +4362,47 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
description: |-
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
employed to update Pods in the StatefulSet when a revision is made to
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
MaxUnavailableStatefulSet feature gate enabled.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters
when Type is RollingUpdateStatefulSetStrategyType.
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding up. This can not be 0.
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
will be counted towards MaxUnavailable.
x-kubernetes-int-or-string: true
partition:
description: |-
Partition indicates the ordinal at which the StatefulSet should be partitioned
for updates. During a rolling update, all pods from ordinal Replicas-1 to
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
This is helpful in being able to do a canary based deployment. The default value is 0.
format: int32
type: integer
type: object
type:
description: |-
Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
type: object
starRocksCnSpec:
description: StarRocksCnSpec define cn configuration for start cn
Expand Down Expand Up @@ -9283,6 +9324,47 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
description: |-
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
employed to update Pods in the StatefulSet when a revision is made to
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
MaxUnavailableStatefulSet feature gate enabled.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters
when Type is RollingUpdateStatefulSetStrategyType.
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding up. This can not be 0.
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
will be counted towards MaxUnavailable.
x-kubernetes-int-or-string: true
partition:
description: |-
Partition indicates the ordinal at which the StatefulSet should be partitioned
for updates. During a rolling update, all pods from ordinal Replicas-1 to
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
This is helpful in being able to do a canary based deployment. The default value is 0.
format: int32
type: integer
type: object
type:
description: |-
Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
type: object
starRocksFeProxySpec:
description: StarRocksLoadSpec define a proxy for fe.
Expand Down Expand Up @@ -15074,6 +15156,47 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
description: |-
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
employed to update Pods in the StatefulSet when a revision is made to
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
MaxUnavailableStatefulSet feature gate enabled.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters
when Type is RollingUpdateStatefulSetStrategyType.
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding up. This can not be 0.
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
will be counted towards MaxUnavailable.
x-kubernetes-int-or-string: true
partition:
description: |-
Partition indicates the ordinal at which the StatefulSet should be partitioned
for updates. During a rolling update, all pods from ordinal Replicas-1 to
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
This is helpful in being able to do a canary based deployment. The default value is 0.
format: int32
type: integer
type: object
type:
description: |-
Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
type: object
type: object
status:
Expand Down
41 changes: 41 additions & 0 deletions config/crd/bases/starrocks.com_starrockswarehouses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4973,6 +4973,47 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
description: |-
StarRocksCluster use StatefulSet to deploy FE/BE/CN components.
UpdateStrategy indicates the StatefulSetUpdateStrategy that will be
employed to update Pods in the StatefulSet when a revision is made to
Template. See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates for more details.
Note: The maxUnavailable field is in Alpha stage and it is honored only by API servers that are running with the
MaxUnavailableStatefulSet feature gate enabled.
properties:
rollingUpdate:
description: RollingUpdate is used to communicate parameters
when Type is RollingUpdateStatefulSetStrategyType.
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
description: |-
The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding up. This can not be 0.
Defaults to 1. This field is alpha-level and is only honored by servers that enable the
MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
will be counted towards MaxUnavailable.
x-kubernetes-int-or-string: true
partition:
description: |-
Partition indicates the ordinal at which the StatefulSet should be partitioned
for updates. During a rolling update, all pods from ordinal Replicas-1 to
Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
This is helpful in being able to do a canary based deployment. The default value is 0.
format: int32
type: integer
type: object
type:
description: |-
Type indicates the type of the StatefulSetUpdateStrategy.
Default is RollingUpdate.
type: string
type: object
type: object
required:
- starRocksCluster
Expand Down
48 changes: 48 additions & 0 deletions deploy/starrocks.com_starrocksclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,22 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
partition:
format: int32
type: integer
type: object
type:
type: string
type: object
type: object
starRocksCnSpec:
properties:
Expand Down Expand Up @@ -4389,6 +4405,22 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
partition:
format: int32
type: integer
type: object
type:
type: string
type: object
type: object
starRocksFeProxySpec:
properties:
Expand Down Expand Up @@ -7072,6 +7104,22 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
partition:
format: int32
type: integer
type: object
type:
type: string
type: object
type: object
type: object
status:
Expand Down
16 changes: 16 additions & 0 deletions deploy/starrocks.com_starrockswarehouses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2374,6 +2374,22 @@ spec:
- whenUnsatisfiable
type: object
type: array
updateStrategy:
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
partition:
format: int32
type: integer
type: object
type:
type: string
type: object
type: object
required:
- starRocksCluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ spec:
{{- end }}
replicas: {{ .Values.starrocksFESpec.replicas }}
imagePullPolicy: {{ .Values.starrocksFESpec.imagePullPolicy }}
{{- if .Values.starrocksFESpec.maxUnavailablePods }}
updateStrategy:
rollingUpdate:
maxUnavailable: "{{ .Values.starrocksFESpec.maxUnavailablePods }}"
{{- end }}
{{- /*
support both resources and resource for backward compatibility
*/}}
Expand Down Expand Up @@ -252,6 +257,11 @@ spec:
{{- end }}
replicas: {{ .Values.starrocksBeSpec.replicas }}
imagePullPolicy: {{ .Values.starrocksBeSpec.imagePullPolicy }}
{{- if .Values.starrocksBeSpec.maxUnavailablePods }}
updateStrategy:
rollingUpdate:
maxUnavailable: "{{ .Values.starrocksBeSpec.maxUnavailablePods }}"
{{- end }}
{{- /*
support both resources and resource for backward compatibility
*/}}
Expand Down Expand Up @@ -512,6 +522,11 @@ spec:
replicas: {{ .Values.starrocksCnSpec.replicas }}
{{- end }}
imagePullPolicy: {{ .Values.starrocksCnSpec.imagePullPolicy }}
{{- if .Values.starrocksCnSpec.maxUnavailablePods }}
updateStrategy:
rollingUpdate:
maxUnavailable: "{{ .Values.starrocksCnSpec.maxUnavailablePods }}"
{{- end }}
{{- if or .Values.starrocksCnSpec.serviceAccount .Values.starrocksCluster.componentValues.serviceAccount }}
serviceAccount: {{ include "starrockscluster.cn.serviceAccount" . }}
{{- end }}
Expand Down
19 changes: 19 additions & 0 deletions helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,13 @@ starrocksFESpec:
# volumeMounts:
# - mountPath: /opt/starrocks/fe/meta
# name: fe-meta # append -meta to the end of the name of the starrocksFESpec.storageSpec.name
# Max unavailable pods for the fe component when doing rolling update.
# This field cannot be 0. The default setting is 1.
# Note: Because Operator uses statefulset to manage this component, the maxUnavailable field is in Alpha stage, and it is honored
# only by API servers that are running with the MaxUnavailableStatefulSet feature gate enabled.
# See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#maximum-unavailable-pods for more details.
maxUnavailablePods:


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

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

# create secrets if necessary.
secrets: []
Expand Down
Loading

0 comments on commit 0c8aefb

Please sign in to comment.