Skip to content

Commit 1400525

Browse files
committed
ddc-skip-default-systeminit
1 parent 61c0147 commit 1400525

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

config/crd/bases/crds.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11361,6 +11361,13 @@ spec:
1136111361
serviceAccount:
1136211362
description: serviceAccount for compute node access cloud service.
1136311363
type: string
11364+
skipDefaultSystemInit:
11365+
description: |-
11366+
SkipDefaultSystemInit is a switch that skips the default initialization and is used to set the default environment configuration required by the doris BE node.
11367+
Default value is 'false'.
11368+
Default System Init means that the container must be started in privileged mode.
11369+
Default System Init configuration is implemented through the initContainers of the pod, so changes to this configuration may be ignored by k8s when it is not the first deployment.
11370+
type: boolean
1136411371
startTimeout:
1136511372
description: pod start timeout, unit is second
1136611373
format: int32

config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,13 @@ spec:
22342234
serviceAccount:
22352235
description: serviceAccount for compute node access cloud service.
22362236
type: string
2237+
skipDefaultSystemInit:
2238+
description: |-
2239+
SkipDefaultSystemInit is a switch that skips the default initialization and is used to set the default environment configuration required by the doris BE node.
2240+
Default value is 'false'.
2241+
Default System Init means that the container must be started in privileged mode.
2242+
Default System Init configuration is implemented through the initContainers of the pod, so changes to this configuration may be ignored by k8s when it is not the first deployment.
2243+
type: boolean
22372244
startTimeout:
22382245
description: pod start timeout, unit is second
22392246
format: int32

pkg/common/utils/resource/pod.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func NewPodTemplateSpec(dcr *v1.DorisCluster, config map[string]interface{}, com
190190
}
191191

192192
// for disaggregated cluster.
193-
func NewPodTemplateSpecWithCommonSpec(skipInit bool, cs *dv1.CommonSpec, componentType dv1.DisaggregatedComponentType) corev1.PodTemplateSpec {
193+
func NewPodTemplateSpecWithCommonSpec(skipDefaultInit bool, cs *dv1.CommonSpec, componentType dv1.DisaggregatedComponentType) corev1.PodTemplateSpec {
194194
var vs []corev1.Volume
195195
si := cs.SystemInitialization
196196
var defaultInitContainers []corev1.Container
@@ -214,7 +214,7 @@ func NewPodTemplateSpecWithCommonSpec(skipInit bool, cs *dv1.CommonSpec, compone
214214
Volumes: vs,
215215
},
216216
}
217-
constructDisaggregatedInitContainers(skipInit, componentType, &pts.Spec, si)
217+
constructDisaggregatedInitContainers(skipDefaultInit, componentType, &pts.Spec, si)
218218
return pts
219219
}
220220

@@ -264,7 +264,7 @@ func constructInitContainers(skipInit bool, componentType v1.ComponentType, podS
264264
podSpec.InitContainers = append(podSpec.InitContainers, defaultInitContains...)
265265
}
266266

267-
func constructDisaggregatedInitContainers(skipInit bool, componentType dv1.DisaggregatedComponentType, podSpec *corev1.PodSpec, si *dv1.SystemInitialization) {
267+
func constructDisaggregatedInitContainers(skipDefaultInit bool, componentType dv1.DisaggregatedComponentType, podSpec *corev1.PodSpec, si *dv1.SystemInitialization) {
268268
initImage := DEFAULT_INIT_IMAGE
269269
var defaultInitContains []corev1.Container
270270
if si != nil {
@@ -287,7 +287,7 @@ func constructDisaggregatedInitContainers(skipInit bool, componentType dv1.Disag
287287
}
288288

289289
// the init containers have sequence,should confirm use initial is always in the first priority.
290-
if !skipInit && componentType == dv1.DisaggregatedBE {
290+
if !skipDefaultInit && componentType == dv1.DisaggregatedBE {
291291
podSpec.InitContainers = append(podSpec.InitContainers, constructBeDefaultInitContainer(initImage))
292292
}
293293
podSpec.InitContainers = append(podSpec.InitContainers, defaultInitContains...)

0 commit comments

Comments
 (0)