Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export WORKING_DIRECTORY_ORIGINAL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && p
cd $WORKING_DIRECTORY_ORIGINAL

source ./project.sh
source ./ensure_helm_deps.sh

echo "Deleting PostgreSQL service..."

Expand Down
47 changes: 47 additions & 0 deletions databases/postgres/k8s/postgres-db/service/ensure_helm_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Ensure curl is available (needed for binary downloads)
if ! command -v curl &>/dev/null; then
apk add --no-cache curl
fi

# Ensure openssl is installed (used for password generation)
if ! command -v openssl &>/dev/null; then
apk add --no-cache openssl
fi

# Ensure jq is installed (used for JSON processing)
if ! command -v jq &>/dev/null; then
apk add --no-cache jq
fi

# Ensure kubectl is installed
if ! command -v kubectl &>/dev/null; then
apk add --no-cache kubectl 2>/dev/null || {
KUBECTL_VERSION=$(curl -fsSL https://dl.k8s.io/release/stable.txt)
curl -fsSL -o /usr/local/bin/kubectl \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
chmod +x /usr/local/bin/kubectl
}
fi

# Ensure helm is installed
if ! command -v helm &>/dev/null; then
apk add --no-cache helm 2>/dev/null || {
HELM_VERSION="v3.17.3"
curl -fsSL -o /tmp/helm.tar.gz \
"https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -xzf /tmp/helm.tar.gz -C /tmp
mv /tmp/linux-amd64/helm /usr/local/bin/helm
chmod +x /usr/local/bin/helm
rm -rf /tmp/helm.tar.gz /tmp/linux-amd64
}
fi

# Ensure gomplate is installed (not available in apk repos)
if ! command -v gomplate &>/dev/null; then
GOMPLATE_VERSION="v3.11.7"
curl -fsSL -o /usr/local/bin/gomplate \
"https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VERSION}/gomplate_linux-amd64"
chmod +x /usr/local/bin/gomplate
fi
1 change: 1 addition & 0 deletions databases/postgres/k8s/postgres-db/service/handle-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export WORKING_DIRECTORY_ORIGINAL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && p
cd $WORKING_DIRECTORY_ORIGINAL

source ./project.sh
source ./ensure_helm_deps.sh

# Add Bitnami Helm repo if not already added
helm repo add bitnami https://charts.bitnami.com/bitnami || true
Expand Down
Loading