-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e11339f
commit 7c3c9f3
Showing
16 changed files
with
347 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# -*- indent-tabs-mode: nil; tab-width: 2; sh-indentation: 2; -*- | ||
|
||
# Install the kind binary | ||
|
||
[ $(uname -m) = x86_64 ] && curl -Lo /tmp/kind https://kind.sigs.k8s.io/dl/v0.25.0/kind-linux-amd64 | ||
[ $(uname -m) = aarch64 ] && curl -Lo /tmp/kind https://kind.sigs.k8s.io/dl/v0.25.0/kind-linux-arm64 | ||
chmod +x /tmp/kind | ||
mv /tmp/kind /usr/local/bin/kind | ||
kind completion zsh > ~/.oh-my-zsh/cache/completions/_kind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# -*- indent-tabs-mode: nil; tab-width: 2; sh-indentation: 2; -*- | ||
|
||
# Install the kubectl binary | ||
|
||
ARCH=$(uname -m) | ||
if [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "amd64" ]; then | ||
ARCH="amd64" | ||
elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "arm64" ]; then | ||
ARCH="arm64" | ||
else | ||
echo "Unsupported architecture: $ARCH" | ||
exit 1 | ||
fi | ||
|
||
KUBECTL_VERSION=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) | ||
echo "Installing kubectl version $KUBECTL_VERSION for $ARCH..." | ||
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl" | ||
chmod +x kubectl | ||
mv kubectl /usr/local/bin/ | ||
kubectl completion zsh > $ZSH/cache/completions/_kubectl | ||
|
||
curl -sLO https://access.cdn.redhat.com/content/origin/files/sha256/99/99f0ecb5477ed1a038e7279252971b4c5d50fa9a877f78610b7d4e4ee02e0589/openshift-client-linux-amd64-rhel9-4.17.6.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# -*- indent-tabs-mode: nil; tab-width: 2; sh-indentation: 2; -*- | ||
|
||
# Install the kubeseal binary | ||
|
||
set -x | ||
set -e | ||
set -o pipefail | ||
|
||
# Determine architecture | ||
ARCH=$(uname -m) | ||
if [ "$ARCH" == "x86_64" ] || [ "$ARCH" == "amd64" ]; then | ||
ARCH="amd64" | ||
elif [ "$ARCH" == "aarch64" ] || [ "$ARCH" == "arm64" ]; then | ||
ARCH="arm64" | ||
else | ||
echo "Unsupported architecture: $ARCH" | ||
exit 1 | ||
fi | ||
|
||
KUBESEAL_VERSION=$(curl -s https://api.github.com/repos/bitnami-labs/sealed-secrets/tags | jq -r '.[0].name' | cut -c 2-) | ||
if [ -z "$KUBESEAL_VERSION" ]; then | ||
echo "Failed to fetch the latest KUBESEAL_VERSION" | ||
exit 1 | ||
fi | ||
|
||
curl -OL "https://github.com/bitnami-labs/sealed-secrets/releases/download/v${KUBESEAL_VERSION}/kubeseal-${KUBESEAL_VERSION}-linux-${ARCH}.tar.gz" | ||
tar -xvzf kubeseal-${KUBESEAL_VERSION}-linux-${ARCH}.tar.gz kubeseal | ||
install -m 755 kubeseal /usr/local/bin/kubeseal | ||
kubeseal completion zsh > ~/.oh-my-zsh/cache/completions/_kubeseal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
deploy/k8s/base/umami/deploy-umami-openshift-env-secret-conversion.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
# -*- indent-tabs-mode: nil; tab-width: 2; sh-indentation: 2; -*- | ||
|
||
# Helper script to filter out `.env`` values related to umami deployment, and generate the secret manifest from that | ||
|
||
source .env | ||
|
||
if [ "$#" -ne 2 ]; then | ||
echo "USAGE: $0 TARGET NAMESPACE | ||
TARGET: The deployment target. Options: [\"OPENSHIFT\", \"KIND\"] | ||
NAMESPACE: The namespace where you want to deploy the umami-secret." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
TARGET="$1" | ||
NAMESPACE="$2" | ||
|
||
|
||
if [ "${TARGET}" == "OPENSHIFT" ]; then | ||
UMAMI_SECRET_FILE_PATH="deploy/k8s/overlays/openshift/umami/umami-secret.yaml" | ||
elif [ "${TARGET}" == "KIND" ]; then | ||
UMAMI_SECRET_FILE_PATH="deploy/k8s/overlays/kind/umami/umami-secret.yaml" | ||
else | ||
echo "Error, \$TARGET ${TARGET} not recongnized. | ||
TARGET options: [\"OPENSHIFT\", \"KIND\"]" | ||
exit 1 | ||
fi | ||
|
||
required_vars=("DATABASE_TYPE" "POSTGRESQL_DATABASE" "POSTGRESQL_USER" "POSTGRESQL_PASSWORD" "UMAMI_APP_SECRET" "DATABASE_URL") | ||
|
||
missing_vars=() | ||
|
||
for var in "${required_vars[@]}"; do | ||
if [[ -z "${!var}" ]]; then | ||
missing_vars+=("$var") | ||
fi | ||
done | ||
|
||
if [[ ${#missing_vars[@]} -gt 0 ]]; then | ||
echo "The following environment variables are missing:" | ||
for var in "${missing_vars[@]}"; do | ||
echo " - $var" | ||
done | ||
echo "Please add these variables to your .env file." | ||
exit 1 | ||
fi | ||
|
||
# Note: `.env` value UMAMI_APP_SECRET is re-routed to APP_SECRET intentionally | ||
kubectl create secret generic umami-secret \ | ||
--from-literal DATABASE_TYPE=${DATABASE_TYPE} \ | ||
--from-literal POSTGRESQL_DATABASE=${POSTGRESQL_DATABASE} \ | ||
--from-literal POSTGRESQL_USER=${POSTGRESQL_USER} \ | ||
--from-literal POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD} \ | ||
--from-literal APP_SECRET=${UMAMI_APP_SECRET} \ | ||
--from-literal DATABASE_URL=${DATABASE_URL} \ | ||
--namespace ${NAMESPACE} \ | ||
--dry-run=client \ | ||
-o yaml > ${UMAMI_SECRET_FILE_PATH} | ||
|
||
echo "Secret manifest has been created: ${UMAMI_SECRET_FILE_PATH}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,5 @@ nodes: | |
image: kindest/node:v1.30.0 | ||
- role: worker | ||
image: kindest/node:v1.30.0 | ||
networking: | ||
apiServerPort: 6443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: umami | ||
resources: | ||
- ../../../base/umami | ||
- umami-ingress.yaml |
Oops, something went wrong.