Skip to content

Commit bb03cd2

Browse files
committed
Enterprise snippets -wip
1 parent 3653724 commit bb03cd2

18 files changed

+257
-88
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kubectl --context "${K8S_CTX}" -n "${MDB_NS}" rollout status --timeout=2m deployment/mongodb-kubernetes-operator
2+
echo "Operator deployment in ${OPERATOR_NAMESPACE} namespace"
3+
kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get deployments
4+
echo; echo "Operator pod in ${OPERATOR_NAMESPACE} namespace"
5+
kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get pods

docs/search/01-search-community-deploy/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ run 01_0045_create_namespaces.sh
1515
run 01_0046_create_image_pull_secrets.sh
1616
run_for_output 01_0090_helm_add_mogodb_repo.sh
1717
run_for_output 01_0100_install_operator.sh
18+
run_for_output 01_0110_wait_for_operator_deployment.sh
1819
run 01_0305_create_mongodb_community_user_secrets.sh
1920
run 01_0310_create_mongodb_community_resource.sh
2021
run_for_output 01_0315_wait_for_community_resource.sh

docs/search/02-search-enterprise-deploy/code_snippets/02_0050_create_ops_manager_resources.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ kubectl --context "${K8S_CTX}" -n "${MDB_NS}" create configmap om-project \
22
--from-literal=projectName="${MDB_RESOURCE_NAME}" --from-literal=baseUrl="${OPS_MANAGER_API_URL}" \
33
--from-literal=orgId="${OPS_MANAGER_ORG_ID:-}"
44

5+
kubectl --context "${K8S_CTX}" -n "${MDB_NS}" create secret generic om-credentials \
6+
--from-literal=publicKey="${OPS_MANAGER_API_USER}" \
7+
--from-literal=privateKey="${OPS_MANAGER_API_KEY}"
8+

docs/search/02-search-enterprise-deploy/code_snippets/02_0305_create_mongodb_database_resource.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ spec:
1010
type: ReplicaSet
1111
opsManager:
1212
configMapRef:
13-
name: ${MDB_OPS_MANAGER_CONFIG_MAP_NAME}
14-
credentials: ${MDB_OPS_MANAGER_CREDENTIALS_SECRET_NAME}
13+
name: om-project
14+
credentials: om-credentials
1515
security:
1616
authentication:
1717
enabled: true

docs/search/02-search-enterprise-deploy/code_snippets/02_0315_create_mongodb_users.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
kubectl --context "${K8S_CTX}" --namespace "${MDB_NS}" \
33
create secret generic mdb-admin-user-password \
44
--from-literal=password="${MDB_ADMIN_USER_PASSWORD}"
5+
56
kubectl apply --context "${K8S_CTX}" -n "${MDB_NS}" -f - <<EOF
67
apiVersion: mongodb.com/v1
78
kind: MongoDBUser

docs/search/02-search-enterprise-deploy/env_variables.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ export K8S_CTX="<local cluster context>"
44
# the following namespace will be created if not exists
55
export MDB_NS="mongodb"
66

7+
8+
export OPS_MANAGER_API_URL="<URL to Ops Manager API>"
9+
export OPS_MANAGER_API_USER="<Ops Manager's API user>"
10+
export OPS_MANAGER_API_KEY="<Ops Manager's API key>"
11+
export OPS_MANAGER_ORG_ID="Ops Manager's Org ID>"
12+
713
# minimum required MongoDB version for running MongoDB Search is 8.0.10
814
export MDB_VERSION="8.0.10"
915

16+
# name of the MongoDB Custom Resource.
1017
export MDB_RESOURCE_NAME="mdb-rs"
1118

1219
# root admin user for convenience, not used here at all in this guide
@@ -16,14 +23,11 @@ export MDB_USER_PASSWORD="mdb-user-password-CHANGE-ME"
1623
# user for MongoDB Search to connect to the replica set to synchronise data from
1724
export MDB_SEARCH_SYNC_USER_PASSWORD="search-sync-user-password-CHANGE-ME"
1825

19-
export OPS_MANAGER_API_URL="<URL to Ops Manager API>"
20-
export OPS_MANAGER_API_USER="<Ops Manager's API user>"
21-
export OPS_MANAGER_API_KEY="<Ops Manager's API key>"
22-
export OPS_MANAGER_ORG_ID="Ops Manager's Org ID>"
2326

2427
export OPERATOR_HELM_CHART="mongodb/mongodb-kubernetes"
2528
# comma-separated key=value pairs for additional parameters passed to the helm-chart installing the operator
2629
export OPERATOR_ADDITIONAL_HELM_VALUES=""
2730

28-
export MDB_CONNECTION_STRING="mongodb://mdb-user:${MDB_USER_PASSWORD}@mdbc-rs-0.mdbc-rs-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=mdbc-rs"
31+
export MDB_CONNECTION_STRING="mongodb://mdb-user:${MDB_USER_PASSWORD}@${MDB_RESOURCE_NAME}-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=mdbc-rs"
32+
echo "new connection string = ${MDB_CONNECTION_STRING}"
2933

docs/search/02-search-enterprise-deploy/env_variables_e2e_private.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ OPERATOR_ADDITIONAL_HELM_VALUES="$(get_operator_helm_values | tr ' ' ',')"
66
export OPERATOR_ADDITIONAL_HELM_VALUES
77
export OPERATOR_HELM_CHART="${PROJECT_DIR}/helm_chart"
88

9-
export MDB_NS="${NAMESPACE}"
10-
export MDB_OPS_MANAGER_CONFIG_MAP_NAME="my-project"
11-
export MDB_OPS_MANAGER_CREDENTIALS_SECRET_NAME="my-credentials"
12-
139
export OPS_MANAGER_API_URL="${OM_BASE_URL}"
1410
export OPS_MANAGER_API_USER="${OM_USER}"
1511
export OPS_MANAGER_API_KEY="${OM_API_KEY}"

0 commit comments

Comments
 (0)