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
3 changes: 2 additions & 1 deletion docs/search/04-search-external-mongod/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably remove that readme completely?

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ 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_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
# For testing purposes, these point to the MongoDB Community resource created by test.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kubectl apply --context "${K8S_CTX}" -n "${MDB_NS}" -f - <<YAML
apiVersion: v1
kind: Service
metadata:
name: ${MDB_SEARCH_HOSTNAME}
name: ${MDB_SEARCH_SERVICE_NAME}
spec:
type: LoadBalancer
selector:
Expand All @@ -13,11 +13,11 @@ spec:
targetPort: 27027
YAML

echo "Waiting for external IP to be assigned to service ${MDB_SEARCH_HOSTNAME}..."
echo "Waiting for external IP to be assigned to service ${MDB_SEARCH_SERVICE_NAME}..."
TIMEOUT=120 # 2 minutes timeout
ELAPSED=0
while [ ${ELAPSED} -lt ${TIMEOUT} ]; do
EXTERNAL_IP=$(kubectl get service "${MDB_SEARCH_HOSTNAME}" --context "${K8S_CTX}" -n "${MDB_NS}" -o jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion docs/search/04-search-external-mongod/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ 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_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
# In production, replace with your actual external MongoDB replica set members
Expand Down