From 717c9bc0fdb93da2af844e97c64860629c68e7ff Mon Sep 17 00:00:00 2001 From: Romanas Sonkinas Date: Wed, 21 Feb 2024 14:52:50 +0000 Subject: [PATCH] Added an init container for grand central ... that explicitly waits for the associated CrateDB to be started. --- CHANGES.rst | 8 ++++++++ crate/operator/grand_central.py | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 960fd31c..b103be81 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,13 @@ Changelog Unreleased ---------- +* Added an init container for grand central, that explicitly waits for the associated + CrateDB to be started. + +* Changed the image pull policy for Grand Central to ``IfNotPresent``, there's no reason + to always pull. + + 2.36.0 (2024-02-21) ------------------- @@ -14,6 +21,7 @@ Unreleased * Fixed a bug that subhandlers were erroneously considered to be timed out. + 2.35.0 (2024-02-15) ------------------- diff --git a/crate/operator/grand_central.py b/crate/operator/grand_central.py index 2df71500..a280bb43 100644 --- a/crate/operator/grand_central.py +++ b/crate/operator/grand_central.py @@ -164,11 +164,20 @@ def get_grand_central_deployment( name=f"{GRAND_CENTRAL_RESOURCE_PREFIX}-{name}", ), spec=V1PodSpec( + init_containers=[ + V1Container( + env=env, + image=spec["grandCentral"]["backendImage"], + image_pull_policy="IfNotPresent", + name="wait-for-crate", + command=["./wait-for-cratedb.py"], + ) + ], containers=[ V1Container( env=env, image=spec["grandCentral"]["backendImage"], - image_pull_policy="Always", + image_pull_policy="IfNotPresent", name=f"{GRAND_CENTRAL_RESOURCE_PREFIX}-api", ports=[ V1ContainerPort(