Skip to content

Commit 8824070

Browse files
committed
feat: add initContainers support to RisingWaveNodePodTemplateSpec
1 parent 089b5fb commit 8824070

File tree

7 files changed

+70462
-46521
lines changed

7 files changed

+70462
-46521
lines changed

apis/risingwave/v1alpha1/risingwave_node_group.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ type RisingWaveNodePodTemplateSpec struct {
290290
// Additional containers to run in the same Pod. The containers will be appended to the Pod's containers array in order.
291291
// + optional
292292
AdditionalContainers []corev1.Container `json:"additionalContainers,omitempty"`
293+
294+
// List of initialization containers belonging to the pod.
295+
// Init containers are executed in order prior to containers being started. If any
296+
// init container fails, the pod is considered to have failed and is handled according
297+
// to its restartPolicy. The name for an init container or normal container must be
298+
// unique among all containers.
299+
// More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
300+
// +optional
301+
InitContainers []corev1.Container `json:"initContainers,omitempty"`
293302
}
294303

295304
// RisingWaveNodePodTemplate determines the Pod specs of a RisingWave node.

apis/risingwave/v1alpha1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/risingwave.risingwavelabs.com_risingwaves.yaml

Lines changed: 23469 additions & 15507 deletions
Large diffs are not rendered by default.

config/risingwave-operator-test.yaml

Lines changed: 23469 additions & 15507 deletions
Large diffs are not rendered by default.

config/risingwave-operator.yaml

Lines changed: 23469 additions & 15507 deletions
Large diffs are not rendered by default.

docs/general/api.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,6 +3443,25 @@ This field is alpha-level and is only honored by servers that enable the UserNam
34433443
<p>Additional containers to run in the same Pod. The containers will be appended to the Pod&rsquo;s containers array in order.</p>
34443444
</td>
34453445
</tr>
3446+
<tr>
3447+
<td>
3448+
<code>initContainers</code><br/>
3449+
<em>
3450+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#container-v1-core">
3451+
[]Kubernetes core/v1.Container
3452+
</a>
3453+
</em>
3454+
</td>
3455+
<td>
3456+
<em>(Optional)</em>
3457+
<p>List of initialization containers belonging to the pod.
3458+
Init containers are executed in order prior to containers being started. If any
3459+
init container fails, the pod is considered to have failed and is handled according
3460+
to its restartPolicy. The name for an init container or normal container must be
3461+
unique among all containers.
3462+
More info: <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/">https://kubernetes.io/docs/concepts/workloads/pods/init-containers/</a></p>
3463+
</td>
3464+
</tr>
34463465
</table>
34473466
</td>
34483467
</tr>
@@ -4012,6 +4031,25 @@ This field is alpha-level and is only honored by servers that enable the UserNam
40124031
<p>Additional containers to run in the same Pod. The containers will be appended to the Pod&rsquo;s containers array in order.</p>
40134032
</td>
40144033
</tr>
4034+
<tr>
4035+
<td>
4036+
<code>initContainers</code><br/>
4037+
<em>
4038+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#container-v1-core">
4039+
[]Kubernetes core/v1.Container
4040+
</a>
4041+
</em>
4042+
</td>
4043+
<td>
4044+
<em>(Optional)</em>
4045+
<p>List of initialization containers belonging to the pod.
4046+
Init containers are executed in order prior to containers being started. If any
4047+
init container fails, the pod is considered to have failed and is handled according
4048+
to its restartPolicy. The name for an init container or normal container must be
4049+
unique among all containers.
4050+
More info: <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/">https://kubernetes.io/docs/concepts/workloads/pods/init-containers/</a></p>
4051+
</td>
4052+
</tr>
40154053
</tbody>
40164054
</table>
40174055
<h3 id="risingwave.risingwavelabs.com/v1alpha1.RisingWaveS3Credentials">RisingWaveS3Credentials

pkg/factory/risingwave_object_factory.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,6 +1714,7 @@ func newPodSpecFromNodeGroupTemplate(template *risingwavev1alpha1.RisingWaveNode
17141714
SetHostnameAsFQDN: template.Spec.SetHostnameAsFQDN,
17151715
OS: template.Spec.OS,
17161716
HostUsers: template.Spec.HostUsers,
1717+
InitContainers: template.Spec.InitContainers,
17171718
}
17181719

17191720
return podTemplateSpec

0 commit comments

Comments
 (0)