From d2df08498241ff75a8b8bc6fc5092fa900d689ba Mon Sep 17 00:00:00 2001 From: Anand Singh Date: Wed, 1 Oct 2025 00:25:17 +0200 Subject: [PATCH 1/2] clarify variable name --- docs/search/04-search-external-mongod/README.md | 2 +- docs/search/04-search-external-mongod/env_variables.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/search/04-search-external-mongod/README.md b/docs/search/04-search-external-mongod/README.md index c84b20ae2..caae50492 100644 --- a/docs/search/04-search-external-mongod/README.md +++ b/docs/search/04-search-external-mongod/README.md @@ -50,7 +50,7 @@ export MDB_USER_PASSWORD="mdb-user-password-CHANGE-ME" # user for MongoDB Search to connect to the replica set to synchronise data from export MDB_SEARCH_SYNC_USER_PASSWORD="search-sync-user-password-CHANGE-ME" -export MDB_SEARCH_HOSTNAME="mdbs-search" +export MDB_SEARCH_HOSTNAME="mdbs-search.example.com" # External MongoDB replica set members - REPLACE THESE VALUES with your actual external MongoDB hosts # For testing purposes, these point to the MongoDB Community resource created by test.sh diff --git a/docs/search/04-search-external-mongod/env_variables.sh b/docs/search/04-search-external-mongod/env_variables.sh index df241dcf4..39f170ffa 100644 --- a/docs/search/04-search-external-mongod/env_variables.sh +++ b/docs/search/04-search-external-mongod/env_variables.sh @@ -8,7 +8,7 @@ export MDB_ADMIN_USER_PASSWORD="admin-user-password-CHANGE-ME" export MDB_USER_PASSWORD="mdb-user-password-CHANGE-ME" export MDB_SEARCH_SYNC_USER_PASSWORD="search-sync-user-password-CHANGE-ME" -export MDB_SEARCH_HOSTNAME="mdbs-search" +export MDB_SEARCH_HOSTNAME="mdbs-search.example.com" # External MongoDB replica set members - REPLACE THESE VALUES with your actual external MongoDB hosts # In production, replace with your actual external MongoDB replica set members From cfc0ca4231c40f207c2f0c973af6700748b526f0 Mon Sep 17 00:00:00 2001 From: Anand Singh Date: Wed, 1 Oct 2025 10:58:04 +0200 Subject: [PATCH 2/2] separate service name and host name --- docs/search/04-search-external-mongod/README.md | 1 + .../04_0322_create_search_loadbalancer_service.sh | 6 +++--- .../code_snippets/04_0323_update_coredns_configmap.sh | 6 +++--- docs/search/04-search-external-mongod/env_variables.sh | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/search/04-search-external-mongod/README.md b/docs/search/04-search-external-mongod/README.md index caae50492..bbb558c4b 100644 --- a/docs/search/04-search-external-mongod/README.md +++ b/docs/search/04-search-external-mongod/README.md @@ -50,6 +50,7 @@ export MDB_USER_PASSWORD="mdb-user-password-CHANGE-ME" # user for MongoDB Search to connect to the replica set to synchronise data from export MDB_SEARCH_SYNC_USER_PASSWORD="search-sync-user-password-CHANGE-ME" +export MDB_SEARCH_SERVICE_NAME="mdbs-search" export MDB_SEARCH_HOSTNAME="mdbs-search.example.com" # External MongoDB replica set members - REPLACE THESE VALUES with your actual external MongoDB hosts diff --git a/docs/search/04-search-external-mongod/code_snippets/04_0322_create_search_loadbalancer_service.sh b/docs/search/04-search-external-mongod/code_snippets/04_0322_create_search_loadbalancer_service.sh index b89db8838..26167b64e 100644 --- a/docs/search/04-search-external-mongod/code_snippets/04_0322_create_search_loadbalancer_service.sh +++ b/docs/search/04-search-external-mongod/code_snippets/04_0322_create_search_loadbalancer_service.sh @@ -2,7 +2,7 @@ kubectl apply --context "${K8S_CTX}" -n "${MDB_NS}" -f - </dev/null) + EXTERNAL_IP=$(kubectl get service "${MDB_SEARCH_SERVICE_NAME}" --context "${K8S_CTX}" -n "${MDB_NS}" -o jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/dev/null) if [ -n "${EXTERNAL_IP}" ] && [ "${EXTERNAL_IP}" != "null" ]; then echo "External IP assigned: ${EXTERNAL_IP}" break diff --git a/docs/search/04-search-external-mongod/code_snippets/04_0323_update_coredns_configmap.sh b/docs/search/04-search-external-mongod/code_snippets/04_0323_update_coredns_configmap.sh index c5f457101..a79e6b123 100644 --- a/docs/search/04-search-external-mongod/code_snippets/04_0323_update_coredns_configmap.sh +++ b/docs/search/04-search-external-mongod/code_snippets/04_0323_update_coredns_configmap.sh @@ -1,10 +1,10 @@ -SEARCH_IP=$(kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get svc "${MDB_SEARCH_HOSTNAME}" -o jsonpath='{.status.loadBalancer.ingress[0].ip}') +SEARCH_IP=$(kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get svc "${MDB_SEARCH_SERVICE_NAME}" -o jsonpath='{.status.loadBalancer.ingress[0].ip}') if [ -z "${SEARCH_IP}" ]; then - SEARCH_IP=$(kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get svc "${MDB_SEARCH_HOSTNAME}" -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') + SEARCH_IP=$(kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get svc "${MDB_SEARCH_SERVICE_NAME}" -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') fi if [ -z "${SEARCH_IP}" ]; then - echo "Error: Could not get LoadBalancer external IP/hostname for service ${MDB_SEARCH_HOSTNAME}" + echo "Error: Could not get LoadBalancer external IP/hostname for service ${MDB_SEARCH_SERVICE_NAME}" exit 1 fi diff --git a/docs/search/04-search-external-mongod/env_variables.sh b/docs/search/04-search-external-mongod/env_variables.sh index 39f170ffa..83cf2e257 100644 --- a/docs/search/04-search-external-mongod/env_variables.sh +++ b/docs/search/04-search-external-mongod/env_variables.sh @@ -8,6 +8,7 @@ export MDB_ADMIN_USER_PASSWORD="admin-user-password-CHANGE-ME" export MDB_USER_PASSWORD="mdb-user-password-CHANGE-ME" export MDB_SEARCH_SYNC_USER_PASSWORD="search-sync-user-password-CHANGE-ME" +export MDB_SEARCH_SERVICE_NAME="mdbs-search" export MDB_SEARCH_HOSTNAME="mdbs-search.example.com" # External MongoDB replica set members - REPLACE THESE VALUES with your actual external MongoDB hosts