Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the confoguration of the mongodb host, adds flexibility to the … #113

Merged
merged 3 commits into from
Jul 11, 2024
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
2 changes: 2 additions & 0 deletions deployment/templates/trs-filer-configmap-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
value: {{ .Values.trs_filer.appName }}
- name: HOST_NAME
value: {{ .Values.host_name }}
- name: MONGO_HOST
value: mongodb-{{ .Values.trs_filer.appName }}
restartPolicy: Never
serviceAccountName: {{ .Values.trs_filer.appName }}-configurer
status: {}
Expand Down
11 changes: 10 additions & 1 deletion update-config-map.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ then
env
exit 1
fi

if [ -z "$MONGO_HOST" ];
lvarin marked this conversation as resolved.
Show resolved Hide resolved
then
MONGO_HOST='mongodb'
lvarin marked this conversation as resolved.
Show resolved Hide resolved
fi

echo "Inputs:"
echo " CONFIG MAP NAME: $CONFIG_MAP_NAME"
echo " API SERVER: $APISERVER"
echo " APP CONFIG PATH: $APP_CONFIG_PATH"
echo " WES APP NAME: $APP_NAME"
echo " HOST NAME: $HOST_NAME"
echo " MONGO_HOST: $MONGO_HOST"

NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)

Expand All @@ -31,9 +38,11 @@ echo "Current Kubernetes namespace: $NAMESPACE"; echo
echo " * Getting current default configuration"

APP_CONFIG=$(yq --arg HOST_NAME "$HOST_NAME" \
--arg MONGO_HOST "$MONGO_HOST" \
lvarin marked this conversation as resolved.
Show resolved Hide resolved
'.endpoints.service.url_prefix = "https" |
.endpoints.service.external_host = $HOST_NAME |
.endpoints.service.external_port = 443' \
.endpoints.service.external_port = 443 |
.db.host = $MONGO_HOST' \
"$APP_CONFIG_PATH") || exit 4

echo " * Getting current configMap"
Expand Down
Loading