mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
Refactor service initialization to enforce dependency order:
- Establish deployment sequence: Registry → OpenBao → Garage → OpenTofu. - Relocate `init_registry.sh` call earlier in flow to align with dependencies. - Update warning messages for missing script scenarios. - Reorganize `init_opentofu.sh` to execute last as it depends on prior services.
This commit is contained in:
parent
4e2541ced3
commit
6c8dc9ed06
@ -596,10 +596,19 @@ case "$ACTION" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_opentofu.sh" ]; then
|
||||
ROLLOUT_TIMEOUT="${ROLLOUT_TIMEOUT:-300s}" "$SCRIPT_DIR/init_opentofu.sh" -n "$NS" "$ACTION" || rc=$?
|
||||
# ---------------------------------------------------------------------------
|
||||
# Deploy services in dependency order:
|
||||
# 1. Registry – no dependencies; other services pull images from it
|
||||
# 2. OpenBao – secrets vault; needed by downstream services
|
||||
# 3. Garage – object storage
|
||||
# 4. OpenTofu – IaC engine; depends on registry + secrets
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_registry.sh" ]; then
|
||||
REGISTRY_NAMESPACE="$REGISTRY_NS" SERVICE_NAMESPACE="$NS" \
|
||||
"$SCRIPT_DIR/init_registry.sh" -n "$REGISTRY_NS" "$ACTION" || rc=$?
|
||||
else
|
||||
echo "WARN: init_opentofu.sh not found; skipping OpenTofu."
|
||||
echo "WARN: init_registry.sh not found; registry deploy skipped."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_openbao.sh" ]; then
|
||||
@ -609,13 +618,6 @@ else
|
||||
echo "WARN: init_openbao.sh not found; skipping OpenBao."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_registry.sh" ]; then
|
||||
REGISTRY_NAMESPACE="$REGISTRY_NS" SERVICE_NAMESPACE="$NS" \
|
||||
"$SCRIPT_DIR/init_registry.sh" -n "$REGISTRY_NS" "$ACTION" || rc=$?
|
||||
else
|
||||
echo "WARN: init_registry.sh not found; registry deploy skipped."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_garage_store.sh" ]; then
|
||||
garage_action="$ACTION"
|
||||
case "$garage_action" in
|
||||
@ -627,6 +629,12 @@ else
|
||||
echo "WARN: init_garage_store.sh not found; garage deploy skipped."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_opentofu.sh" ]; then
|
||||
ROLLOUT_TIMEOUT="${ROLLOUT_TIMEOUT:-300s}" "$SCRIPT_DIR/init_opentofu.sh" -n "$NS" "$ACTION" || rc=$?
|
||||
else
|
||||
echo "WARN: init_opentofu.sh not found; skipping OpenTofu."
|
||||
fi
|
||||
|
||||
if [[ "$ENABLE_KERBEROS" == "1" ]]; then
|
||||
# KDC is now embedded in the `knoe-auth` pod (multi-container) by default.
|
||||
# Only deploy a standalone KDC when explicitly requested.
|
||||
|
||||
@ -596,10 +596,19 @@ case "$ACTION" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_opentofu.sh" ]; then
|
||||
ROLLOUT_TIMEOUT="${ROLLOUT_TIMEOUT:-300s}" "$SCRIPT_DIR/init_opentofu.sh" -n "$NS" "$ACTION" || rc=$?
|
||||
# ---------------------------------------------------------------------------
|
||||
# Deploy services in dependency order:
|
||||
# 1. Registry – no dependencies; other services pull images from it
|
||||
# 2. OpenBao – secrets vault; needed by downstream services
|
||||
# 3. Garage – object storage
|
||||
# 4. OpenTofu – IaC engine; depends on registry + secrets
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_registry.sh" ]; then
|
||||
REGISTRY_NAMESPACE="$REGISTRY_NS" SERVICE_NAMESPACE="$NS" \
|
||||
"$SCRIPT_DIR/init_registry.sh" -n "$REGISTRY_NS" "$ACTION" || rc=$?
|
||||
else
|
||||
echo "WARN: init_opentofu.sh not found; skipping OpenTofu."
|
||||
echo "WARN: init_registry.sh not found; registry deploy skipped."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_openbao.sh" ]; then
|
||||
@ -609,13 +618,6 @@ else
|
||||
echo "WARN: init_openbao.sh not found; skipping OpenBao."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_registry.sh" ]; then
|
||||
REGISTRY_NAMESPACE="$REGISTRY_NS" SERVICE_NAMESPACE="$NS" \
|
||||
"$SCRIPT_DIR/init_registry.sh" -n "$REGISTRY_NS" "$ACTION" || rc=$?
|
||||
else
|
||||
echo "WARN: init_registry.sh not found; registry deploy skipped."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_garage_store.sh" ]; then
|
||||
garage_action="$ACTION"
|
||||
case "$garage_action" in
|
||||
@ -627,6 +629,12 @@ else
|
||||
echo "WARN: init_garage_store.sh not found; garage deploy skipped."
|
||||
fi
|
||||
|
||||
if [ -x "$SCRIPT_DIR/init_opentofu.sh" ]; then
|
||||
ROLLOUT_TIMEOUT="${ROLLOUT_TIMEOUT:-300s}" "$SCRIPT_DIR/init_opentofu.sh" -n "$NS" "$ACTION" || rc=$?
|
||||
else
|
||||
echo "WARN: init_opentofu.sh not found; skipping OpenTofu."
|
||||
fi
|
||||
|
||||
if [[ "$ENABLE_KERBEROS" == "1" ]]; then
|
||||
if [ -x "$SCRIPT_DIR/init_kdc.sh" ]; then
|
||||
kdc_action="$ACTION"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user