diff --git a/.evergreen-snippets.yml b/.evergreen-snippets.yml index a6eb1a932..c5a209920 100644 --- a/.evergreen-snippets.yml +++ b/.evergreen-snippets.yml @@ -14,16 +14,21 @@ variables: - &setup_and_teardown_group_kind_code_snippets setup_task_can_fail_task: true + setup_group_can_fail_task: true setup_group: - func: clone - func: cleanup_exec_environment - func: download_kube_tools - func: configure_docker_auth - func: setup_kubernetes_environment + - func: python_venv + - func: setup_cloud_qa teardown_task: - func: upload_e2e_logs - func: upload_code_snippets_logs - func: upload_code_snippets_outputs + - func: teardown_kubernetes_environment + - func: teardown_cloud_qa # This variable is copied over from .evergreen.yml because anchors don't work for included files - &base_om8_dependency @@ -110,6 +115,12 @@ tasks: - func: test_code_snippets - func: sample_commit_output + - name: test_kind_search_enterprise_snippets.sh + tags: [ "code_snippets", "patch-run" ] + commands: + - func: test_code_snippets + - func: sample_commit_output + task_groups: - name: gke_code_snippets_task_group <<: *setup_and_teardown_group_gke_code_snippets @@ -123,6 +134,7 @@ task_groups: max_hosts: -1 tasks: - test_kind_search_community_snippets.sh + - test_kind_search_enterprise_snippets.sh buildvariants: # These variants are used to test the code snippets and each one can be used in patches diff --git a/.evergreen-tasks.yml b/.evergreen-tasks.yml index bd3c32d40..0cc5ae86c 100644 --- a/.evergreen-tasks.yml +++ b/.evergreen-tasks.yml @@ -84,7 +84,13 @@ tasks: - func: test_code_snippets - func: sample_commit_output - - name: task_kind_community_search_snippets + - name: task_kind_search_community_snippets + tags: [ "code_snippets", "patch-run" ] + commands: + - func: test_code_snippets + - func: sample_commit_output + + - name: task_kind_search_enterprise_snippets tags: [ "code_snippets", "patch-run" ] commands: - func: test_code_snippets diff --git a/docker/mongodb-kubernetes-tests/tests/search/fixtures/mongodbuser-search-sync-source-user.yaml b/docker/mongodb-kubernetes-tests/tests/search/fixtures/mongodbuser-search-sync-source-user.yaml index d6ce56d8f..c56884ede 100644 --- a/docker/mongodb-kubernetes-tests/tests/search/fixtures/mongodbuser-search-sync-source-user.yaml +++ b/docker/mongodb-kubernetes-tests/tests/search/fixtures/mongodbuser-search-sync-source-user.yaml @@ -1,4 +1,4 @@ -# user used by MongoDB Search to connect to MongoDB database to synchronize data from. +# User used by MongoDB Search to connect to MongoDB database to synchronize data from. # For MongoDB <8.2, the operator will be creating the searchCoordinator custom role automatically # From MongoDB 8.2, searchCoordinator role will be a built-in role. apiVersion: mongodb.com/v1 diff --git a/docs/community-search/quick-start/README.md b/docs/community-search/quick-start/README.md deleted file mode 100644 index 3934db1ab..000000000 --- a/docs/community-search/quick-start/README.md +++ /dev/null @@ -1,442 +0,0 @@ -# MongoDB Community Search on Kubernetes - Quick Start - -This guide provides instructions for deploying MongoDB Community Edition along with its Search capabilities onto a Kubernetes cluster. By following these steps, you will set up a MongoDB instance and configure search indexes to perform full-text search queries against your data. - -## Prerequisites - -Community Search is currently in private preview, and access to the image requires a secret to pull the search container image from Quay.io. This secret is specified during the first step of the process below, and must be obtained from MongoDB when requesting access to the private preview. - -Before you begin, ensure you have the following tools and configurations in place: - -- **Kubernetes cluster**: A running Kubernetes cluster (e.g., Minikube, Kind, GKE, EKS, AKS). -- **kubectl**: The Kubernetes command-line tool, configured to communicate with your cluster. -- **Helm**: The package manager for Kubernetes, used here to install the MongoDB Kubernetes Operator. -- **Bash 5.1+**: All shell commands in this guide are intended to be run in Bash. Scripts in this guide are automatically tested on Linux with Bash 5.1. - -## Setup Steps - -The following steps guide you through deploying MongoDB Community with Search. Each step provides a shell script. -**It is important to first source the `env_variables.sh` script provided and customize its values for your environment.** -The subsequent script snippets rely on the environment variables defined in `env_variables.sh`. You should copy and paste each script into your Bash terminal. - -### 1. Configure Environment Variables - -First, you need to set up your environment. The `env_variables.sh` script, shown below, contains variables for the subsequent steps. You should create this file locally or use the linked one. - -Download or copy the content of `env_variables.sh`: -[env_variables.sh](env_variables.sh) -```shell copy -# set it to the context name of the k8s cluster -export K8S_CLUSTER_0_CONTEXT_NAME="" - -# At the private preview stage the community search image is accessible only from a private repository. -# Please contact MongoDB Support to get access. -export PRIVATE_PREVIEW_IMAGE_PULLSECRET="<.dockerconfigjson>" - -# the following namespace will be created if not exists -export MDB_NAMESPACE="mongodb" - -export MDB_ADMIN_USER_PASSWORD="admin-user-password-CHANGE-ME" -export MDB_SEARCH_USER_PASSWORD="search-user-password-CHANGE-ME" - -export OPERATOR_HELM_CHART="mongodb/mongodb-kubernetes" -# comma-separated key=value pairs for additional parameters passed to the helm-chart installing the operator -export OPERATOR_ADDITIONAL_HELM_VALUES="" -``` -This will load the variables into your current shell session, making them available for the commands in the following steps. - -### 2. Add MongoDB Helm Repository - -First, add the MongoDB Helm repository. This repository contains the Helm chart required to install the MongoDB Kubernetes Operator. The operator automates the deployment and management of MongoDB instances (both Community and Enterprise editions) on Kubernetes. - -[code_snippets/090_helm_add_mogodb_repo.sh](code_snippets/090_helm_add_mogodb_repo.sh) -```shell copy -helm repo add mongodb https://mongodb.github.io/helm-charts -helm repo update mongodb -helm search repo mongodb/mongodb-kubernetes -``` - -### 3. Install MongoDB Kubernetes Operator - -Next, install the MongoDB Kubernetes Operator from the Helm repository you just added. The Operator will watch for MongoDBCommunity and MongoDBSearch custom resources and manage the lifecycle of your MongoDB deployments. - -[code_snippets/0100_install_operator.sh](code_snippets/0100_install_operator.sh) -```shell copy -helm upgrade --install --debug --kube-context "${K8S_CLUSTER_0_CONTEXT_NAME}" \ - --create-namespace \ - --namespace="${MDB_NAMESPACE}" \ - mongodb-kubernetes \ - --set "${OPERATOR_ADDITIONAL_HELM_VALUES:-"dummy=value"}" \ - "${OPERATOR_HELM_CHART}" -``` -This command installs the operator in the `mongodb` namespace (creating it if it doesn't exist) and names the release `community-operator`. - -### 4. Configure Pull Secret for MongoDB Community Search - -To use MongoDB Search, your Kubernetes cluster needs to pull the necessary container images. This step creates a Kubernetes secret named `community-private-preview-pullsecret`. This secret stores the credentials required to access the image repository for MongoDB Search. The script then patches the `mongodb-kubernetes-database-pods` service account to include this pull secret, allowing pods managed by this service account to pull the required images. - -[code_snippets/0200_configure_community_search_pullsecret.sh](code_snippets/0200_configure_community_search_pullsecret.sh) -```shell copy -kubectl apply --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" -f - < /tmp/mdb_script.js -mongosh --quiet "mongodb://search-user:${MDB_SEARCH_USER_PASSWORD}@mdbc-rs-0.mdbc-rs-svc.${MDB_NAMESPACE}.svc.cluster.local:27017/?replicaSet=mdbc-rs" < /tmp/mdb_script.js -EOF -)" -``` \ No newline at end of file diff --git a/docs/community-search/quick-start/README.md.j2 b/docs/community-search/quick-start/README.md.j2 deleted file mode 100644 index 0e3125075..000000000 --- a/docs/community-search/quick-start/README.md.j2 +++ /dev/null @@ -1,206 +0,0 @@ -# MongoDB Community Search on Kubernetes - Quick Start - -This guide provides instructions for deploying MongoDB Community Edition along with its Search capabilities onto a Kubernetes cluster. By following these steps, you will set up a MongoDB instance and configure search indexes to perform full-text search queries against your data. - -## Prerequisites - -Community Search is currently in private preview, and access to the image requires a secret to pull the search container image from Quay.io. This secret is specified during the first step of the process below, and must be obtained from MongoDB when requesting access to the private preview. - -Before you begin, ensure you have the following tools and configurations in place: - -- **Kubernetes cluster**: A running Kubernetes cluster (e.g., Minikube, Kind, GKE, EKS, AKS). -- **kubectl**: The Kubernetes command-line tool, configured to communicate with your cluster. -- **Helm**: The package manager for Kubernetes, used here to install the MongoDB Kubernetes Operator. -- **Bash 5.1+**: All shell commands in this guide are intended to be run in Bash. Scripts in this guide are automatically tested on Linux with Bash 5.1. - -## Setup Steps - -The following steps guide you through deploying MongoDB Community with Search. Each step provides a shell script. -**It is important to first source the `env_variables.sh` script provided and customize its values for your environment.** -The subsequent script snippets rely on the environment variables defined in `env_variables.sh`. You should copy and paste each script into your Bash terminal. - -### 1. Configure Environment Variables - -First, you need to set up your environment. The `env_variables.sh` script, shown below, contains variables for the subsequent steps. You should create this file locally or use the linked one. - -Download or copy the content of `env_variables.sh`: -[env_variables.sh](env_variables.sh) -```shell copy -{% include "env_variables.sh" %} -``` -This will load the variables into your current shell session, making them available for the commands in the following steps. - -### 2. Add MongoDB Helm Repository - -First, add the MongoDB Helm repository. This repository contains the Helm chart required to install the MongoDB Kubernetes Operator. The operator automates the deployment and management of MongoDB instances (both Community and Enterprise editions) on Kubernetes. - -[code_snippets/090_helm_add_mogodb_repo.sh](code_snippets/090_helm_add_mogodb_repo.sh) -```shell copy -{% include "code_snippets/090_helm_add_mogodb_repo.sh" %} -``` - -### 3. Install MongoDB Kubernetes Operator - -Next, install the MongoDB Kubernetes Operator from the Helm repository you just added. The Operator will watch for MongoDBCommunity and MongoDBSearch custom resources and manage the lifecycle of your MongoDB deployments. - -[code_snippets/0100_install_operator.sh](code_snippets/0100_install_operator.sh) -```shell copy -{% include "code_snippets/0100_install_operator.sh" %} -``` -This command installs the operator in the `mongodb` namespace (creating it if it doesn't exist) and names the release `community-operator`. - -### 4. Configure Pull Secret for MongoDB Community Search - -To use MongoDB Search, your Kubernetes cluster needs to pull the necessary container images. This step creates a Kubernetes secret named `community-private-preview-pullsecret`. This secret stores the credentials required to access the image repository for MongoDB Search. The script then patches the `mongodb-kubernetes-database-pods` service account to include this pull secret, allowing pods managed by this service account to pull the required images. - -[code_snippets/0200_configure_community_search_pullsecret.sh](code_snippets/0200_configure_community_search_pullsecret.sh) -```shell copy -{% include "code_snippets/0200_configure_community_search_pullsecret.sh" %} -``` -This script creates a `community-private-preview-pullsecret` secret in your Kubernetes namespace and associates it with the service account used for MongoDB pods. - -### 5. Verify Pull Secret Configuration - -Confirm that the `community-private-preview-pullsecret` has been successfully added to the `mongodb-kubernetes-database-pods` service account. This ensures that Kubernetes can authenticate with the container registry when pulling images for MongoDB Search pods. - -[code_snippets/0210_verify_community_search_pullsecret.sh](code_snippets/0210_verify_community_search_pullsecret.sh) -```shell copy -{% include "code_snippets/0210_verify_community_search_pullsecret.sh" %} -``` -This command checks the `mongodb-kubernetes-database-pods` service account to confirm the presence of `community-private-preview-pullsecret`. - -## Creating a MongoDB Community Search Deployment - -With the prerequisites and initial setup complete, you can now deploy MongoDB Community Edition and enable Search. - -### 6. Create MongoDB User Secrets - -MongoDB requires authentication for secure access. This step creates two Kubernetes secrets: `admin-user-password` and `search-user-password`. These secrets store the credentials for the MongoDB administrative user and a dedicated search user, respectively. These secrets will be mounted into the MongoDB pods. - -[code_snippets/0305_create_mongodb_community_user_secrets.sh](code_snippets/0305_create_mongodb_community_user_secrets.sh) -```shell copy -{% include "code_snippets/0305_create_mongodb_community_user_secrets.sh" %} -``` -Ensure these secrets are created in the same namespace where you plan to deploy MongoDB. - -### 7. Create MongoDB Community Resource - -Now, deploy MongoDB Community by creating a `MongoDBCommunity` custom resource named `mdbc-rs`. This resource definition instructs the MongoDB Kubernetes Operator to configure a MongoDB replica set with 3 members, running version 8.0.6. MongoDB Community Search is supported only from MongoDB Community Server version 8.0. It also defines CPU and memory resources for the `mongod` and `mongodb-agent` containers, and sets up two users (`admin-user` and `search-user`) with their respective roles and password secrets. User `search-user` will be used to restore, connect and perform search queries on the `sample_mflix` database. - -[code_snippets/0310_create_mongodb_community_resource.sh](code_snippets/0310_create_mongodb_community_resource.sh) -```yaml copy -{% include "code_snippets/0310_create_mongodb_community_resource.sh" %} -``` - -### 8. Wait for MongoDB Community Resource to be Ready - -After applying the `MongoDBCommunity` custom resource, the operator begins deploying the MongoDB nodes (pods). This step uses `kubectl wait` to pause execution until the `mdbc-rs` resource's status phase becomes `Running`, indicating that the MongoDB Community replica set is operational. - -[code_snippets/0315_wait_for_community_resource.sh](code_snippets/0315_wait_for_community_resource.sh) -```shell copy -{% include "code_snippets/0315_wait_for_community_resource.sh" %} -``` - -### 9. Create MongoDB Search Resource - -Once your MongoDB deployment is ready, enable Search capabilities by creating a `MongoDBSearch` custom resource, also named `mdbc-rs` to associate it with the MongoDB instance. This resource specifies the CPU and memory resource requirements for the search nodes. - -Note: Private preview of MongoDB Community Search comes with some limitations, and it is not suitable for production use: -* TLS cannot be enabled in MongoDB Community deployment (MongoD communicates with MongoT with plain text). -* Only one node of search node is supported (load balancing not supported) - -[code_snippets/0320_create_mongodb_search_resource.sh](code_snippets/0320_create_mongodb_search_resource.sh) -```shell copy -{% include "code_snippets/0320_create_mongodb_search_resource.sh" %} -``` - -The `MongoDBSearch.spec` fields are supported: -* `spec.source.mongodbResourceRef.name` - omitted in the example as the MongoDBSearch CR has the same name as MongoDBCommunity CR allowing to integrate both using naming convention. While keeping the same name is recommended (you cannot have more than one MongoDBSearch resources referencing the same MongoDBCommunity resource - it's 1:1 relationship) it's not enforced. The name can be different, but then you must explicitly point to the MongoDBCommunity you would like to enable search in. Note that you enable search capabilities by deploying search component (with MongoDBSearch CR) and nothing is necessary to define in MongoDBCommunity CR to configure it for search - it will be configured automatically by recognising there is related MongoDBSearch pointing to it. -* `spec.version`: Version of mongodb-community-search. By default, the operator chooses the MongoDB Search version automatically, but it is possible to specify it explicitly. Currently, the default value is `1.47.0`. -* `spec.statefulSet`: Optional statefulset overrides, which are applied last to the mongot's statefulset. It is possible to adjust any statefulset configuration that was create by the operator (the overrides are applied last). The type of the field is [apps/v1/StatefulSet](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#statefulset-v1-apps) and both `spec.statefulSet.spec` and `spec.statefulSet.metadata` fields are supported. -* `spec.persistence.single`: optional storage configuration for MongoDB Search persistence volume containing storing search indexes. See [here](https://www.mongodb.com/docs/kubernetes/current/reference/k8s-operator-specification/#mongodb-setting-spec.podSpec.persistence.single) for more information about storage settings. MongoDBSearch reuses the same persistence type as in other custom resources (e.g. `MongoDB`), but supports only `single` persistence field. If not set, the operator sets `spec.persistence.single.storage = 10G`. -* `spec.resourceRequirements` - resource requests and limits for mongodb-search container. It's recommended to use this field to customize resource allocations instead of overriding it via `spec.statefulSet` overrides. If not set, the operator sets the following values (no limits, only requests): -```yaml -requests: - cpu: 2 - memory: 2G -``` - -### 10. Wait for Search Resource to be Ready - -Similar to the MongoDB deployment, the Search deployment needs time to initialize. This step uses `kubectl wait` to pause until the `MongoDBSearch` resource `mdbc-rs` reports a `Running` status in its `.status.phase` field, indicating that the search nodes are operational and integrated. - -[code_snippets/0325_wait_for_search_resource.sh](code_snippets/0325_wait_for_search_resource.sh) -```shell copy -{% include "code_snippets/0325_wait_for_search_resource.sh" %} -``` -This command polls the status of the `MongoDBSearch` resource `mdbc-rs`. - -### 11. Verify MongoDB Community Resource Status - -Double-check the status of your `MongoDBCommunity` resource to ensure it remains healthy and that the integration with the Search resource is reflected if applicable. - -[code_snippets/0330_wait_for_community_resource.sh](code_snippets/0330_wait_for_community_resource.sh) -```shell copy -{% include "code_snippets/0330_wait_for_community_resource.sh" %} -``` -This provides a final confirmation that the core database is operational. - -### 12. List Running Pods - -View all the running pods in your namespace. You should see pods for the MongoDB replica set members, the MongoDB Kubernetes Operator, and the MongoDB Search nodes. - -[code_snippets/0335_show_running_pods.sh](code_snippets/0335_show_running_pods.sh) -```shell copy -{% include "code_snippets/0335_show_running_pods.sh" %} -``` - -## Using MongoDB Search - -Now that your MongoDB Community database with Search is deployed, you can start using its search capabilities. - -### 13. Deploy MongoDB Tools Pod - -To interact with your MongoDB deployment, this step deploys a utility pod named `mongodb-tools-pod`. This pod runs a MongoDB Community Server image and is kept running with a `sleep infinity` command, allowing you to use `kubectl exec` to run MongoDB client tools like `mongosh` and `mongorestore` from within the Kubernetes cluster. Running steps in a pod inside the cluster simplifies connectivity to mongodb without neeeding to expose the database externally (provided steps directly connect to the *.cluster.local hostnames). - -[code_snippets/0410_run_mongodb_tools_pod.sh](code_snippets/0410_run_mongodb_tools_pod.sh) -```shell copy -{% include "code_snippets/0410_run_mongodb_tools_pod.sh" %} -``` - -### 14. Import Sample Data - -To test the search functionality, this step imports the `sample_mflix.movies` collection. It downloads the sample dataset and uses `mongorestore` to load the data into the `sample_mflix` database in your MongoDB deployment, connecting as the `search-user`. - -[code_snippets/0420_import_movies_mflix_database.sh](code_snippets/0420_import_movies_mflix_database.sh) -```shell copy -{% include "code_snippets/0420_import_movies_mflix_database.sh" %} -``` -This command uses `mongorestore` from the `mongodb-tools-pod` to load data from the downloaded `sample_mflix.archive` file. - -### 15. Create Search Index - -Before performing search queries, create a search index. This step uses `kubectl exec` to run `mongosh` in the `mongodb-tools-pod`. It connects to the `sample_mflix` database as `search-user` and calls `db.movies.createSearchIndex()` to create a search index named "default" with dynamic mappings on the `movies` collection. Dynamic mapping automatically indexes all fields with supported types. MongoDB Search offers flexible index definitions, allowing for dynamic and static field mappings, various analyzer types (standard, language-specific, custom), and features like synonyms and faceted search. - -[code_snippets/0430_create_search_index.sh](code_snippets/0430_create_search_index.sh) -```shell copy -{% include "code_snippets/0430_create_search_index.sh" %} -``` - -### 16. Wait for Search Index to be Ready - -Creating a search index is an asynchronous operation. This script polls periodically the status by executing `db.movies.getSearchIndexes("default")`. - -[code_snippets/0440_wait_for_search_index_ready.sh](code_snippets/0440_wait_for_search_index_ready.sh) -```shell copy -{% include "code_snippets/0440_wait_for_search_index_ready.sh" %} -``` - -### 17. Execute a Search Query - -Once the search index is ready, execute search queries using the `$search` aggregation pipeline stage. MongoDB Search supports a query language, allowing for various types of queries such as text search, autocomplete, faceting, and more. You can combine `$search` with other aggregation stages to further refine and process your results. - -[code_snippets/0450_execute_search_query.sh](code_snippets/0450_execute_search_query.sh) -```shell copy -{% include "code_snippets/0450_execute_search_query.sh" %} -``` diff --git a/docs/community-search/quick-start/code_snippets/0045_create_namespaces.sh b/docs/community-search/quick-start/code_snippets/0045_create_namespaces.sh deleted file mode 100644 index 7d0899c63..000000000 --- a/docs/community-search/quick-start/code_snippets/0045_create_namespaces.sh +++ /dev/null @@ -1 +0,0 @@ -kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" create namespace "${MDB_NAMESPACE}" diff --git a/docs/community-search/quick-start/code_snippets/0200_configure_community_search_pullsecret.sh b/docs/community-search/quick-start/code_snippets/0200_configure_community_search_pullsecret.sh deleted file mode 100644 index 59310c81f..000000000 --- a/docs/community-search/quick-start/code_snippets/0200_configure_community_search_pullsecret.sh +++ /dev/null @@ -1,25 +0,0 @@ -kubectl apply --context "${K8S_CLUSTER_0_CONTEXT_NAME}" -n "${MDB_NAMESPACE}" -f - < /tmp/mdb_script.js -mongosh --quiet "mongodb://search-user:${MDB_SEARCH_USER_PASSWORD}@mdbc-rs-0.mdbc-rs-svc.${MDB_NAMESPACE}.svc.cluster.local:27017/?replicaSet=mdbc-rs" < /tmp/mdb_script.js +mongosh --quiet "${MDB_CONNECTION_STRING}" < /tmp/mdb_script.js EOF )" diff --git a/docs/search/03-search-query-usage/code_snippets/03_0455_execute_vector_search_query.sh b/docs/search/03-search-query-usage/code_snippets/03_0455_execute_vector_search_query.sh new file mode 100644 index 000000000..fb522d697 --- /dev/null +++ b/docs/search/03-search-query-usage/code_snippets/03_0455_execute_vector_search_query.sh @@ -0,0 +1,30 @@ +mdb_script=$(cat <<'EOF' +use sample_mflix; +db.embedded_movies.aggregate([ + { + "$vectorSearch": { + "index": "vector_index", + "path": "plot_embedding_voyage_3_large", + "queryVector": [-0.034731735,0.008558298,-0.0153717,-0.029912498,0.011549547,0.010261648,-0.011964999,-0.023265276,0.010303194,-0.006896493,-0.00054528,0.003926015,-0.025757983,0.027419789,0.001199616,-0.036227357,-0.005297005,0.021935832,0.010303194,-0.019193852,0.025093261,-0.040049512,-0.033900831,-0.011466458,-0.01827986,-0.0153717,0.023265276,0.007727395,0.000114249,0.005317777,-0.043871664,-0.02127111,-0.019609304,0.016368784,-0.004756918,0.003552109,0.006522586,-0.005400868,-0.015620971,-0.034565553,-0.018695312,-0.023099095,0.050851244,-0.034731735,0.004819236,0.022268193,-0.095719993,0.05517194,-0.046198189,-0.036393538,0.007187308,-0.02459472,-0.036725901,0.009472291,0.019027673,0.020938748,-0.011051006,0.027087428,0.04586583,-0.022600554,-0.05517194,0.044204023,0.01213118,0.047859997,-0.03938479,0.002928932,0.002056484,0.019443123,-0.028583053,0.013543714,0.022932915,0.011632638,0.004923099,0.000389486,0.020024756,-0.024096178,-0.022766734,0.011217186,-0.003198975,0.007104218,-0.047195274,-0.013377533,0.013294443,0.024096178,-0.056501385,-0.026755067,-0.008433662,-0.001911076,0.007976666,-0.008101301,-0.014042255,0.008641388,-0.02176965,0.010012378,-0.000607598,-0.024927082,0.024927082,-0.018612221,-0.001184036,0.005567048,0.001324251,-0.019526213,-0.023597637,0.060489718,-0.010178559,-0.019609304,0.004112968,-0.011217186,-0.031574301,-0.008766023,0.005483958,-0.061819162,-0.023431456,-0.040714234,0.015039339,0.026422706,0.016202603,0.004653055,0.041046593,-0.018030589,0.040381871,-0.002638116,0.013045172,0.004216831,0.005650138,0.027419789,0.003926015,-0.028749233,0.004798463,-0.030244859,0.063813329,0.007145763,-0.017448956,0.025591804,-0.045201108,0.010718645,0.002804297,0.014291527,0.04586583,-0.015205519,-0.021603471,-0.035230275,0.00760276,0.033236109,0.016534964,-0.043206941,-0.003115885,-0.026256526,0.005940954,0.016534964,0.024262359,-0.001630647,0.028084511,-0.012795902,0.007270399,0.001381376,-0.009763107,-0.006896493,0.008433662,-0.019360034,0.000386889,0.030411039,0.025591804,0.010469374,0.037722982,-0.001147684,-0.005400868,0.052845411,-0.052513052,0.00768585,-0.004299921,0.00922302,0.011881908,0.012962082,-0.068798743,0.003593654,0.020938748,-0.013792985,-0.034565553,-0.007519669,-0.04021569,-0.020689478,0.006273315,0.046862911,0.006107135,0.002638116,-0.013792985,-0.005400868,-0.020274026,0.007644305,-0.010801735,0.026422706,0.043871664,0.003780607,0.010261648,-0.064145692,0.011881908,-0.009056839,0.009347656,-0.02459472,0.026422706,0.033236109,0.041212775,0.019027673,-0.00315743,0.004424557,0.020689478,-0.0153717,-0.015205519,-0.034897912,0.020274026,0.016867325,0.040714234,-0.022766734,-0.010967916,0.026256526,0.007062673,-0.015953332,-0.007727395,0.031574301,-0.002887387,-0.00614868,0.004569965,0.019027673,0.012878992,0.011798819,0.004258377,-0.019193852,-0.021437289,-0.021603471,0.000301202,-0.051183607,-0.004985416,-0.030078677,0.012629721,0.065142773,-0.031740483,-0.021104928,-0.03938479,-0.003365156,-0.016036423,0.036393538,0.009804652,-0.018612221,0.060489718,-0.003697517,0.000547876,0.063480966,0.02758597,0.010053922,-0.003655972,-0.001485239,0.018362951,0.021104928,-0.003905243,0.019443123,-0.002658889,-0.00380138,-0.013626805,0.035894997,0.035396457,-0.005691683,0.002762751,0.012878992,-0.009596926,-0.009970833,-0.015953332,0.022434372,0.00614868,-0.021188019,0.001557943,-0.020190936,0.009763107,0.017448956,0.006730312,0.005567048,0.019692395,-0.00218112,-0.016867325,0.006854947,0.007976666,0.019193852,0.040880412,0.007353489,-0.02127111,-0.031906664,-0.026755067,-0.017947499,0.040381871,0.042209856,0.00913993,-0.0307434,-0.017781317,-0.015039339,0.03057722,0.017532047,0.0187784,-0.060822077,0.002928932,-0.026422706,-0.005899409,0.039717149,0.026588887,-0.000971118,0.004923099,-0.013626805,0.0187784,-0.031408124,-0.000695881,0.050851244,-0.014457707,-0.007311944,-0.001293092,-0.002139574,-0.019276943,0.00290816,0.019360034,-0.017781317,0.002160347,0.016618054,-0.006522586,0.011798819,0.029247776,-0.02775215,0.010344739,-0.018362951,-0.036725901,-0.015870241,0.015704062,-0.012463541,0.02459472,-0.024096178,0.001152877,-0.031408124,0.025425622,0.027087428,0.00922302,0.034565553,0.015704062,-0.020689478,-0.00517237,-0.014706978,-0.001589101,0.026090344,0.014956249,0.011715728,0.004299921,-0.00913993,0.022434372,-0.03705826,0.048524719,-0.030411039,0.008433662,0.017033506,-0.000511525,-0.031408124,0.005940954,-0.012962082,-0.031574301,0.017448956,0.010178559,-0.011383367,-0.020107845,-0.005151597,0.006647222,0.013128263,0.007145763,0.008059756,-0.045201108,-0.004943871,0.015787151,-0.045201108,-0.020772567,-0.020274026,0.028250692,-0.024262359,-0.004424557,0.009804652,0.000472576,-0.005691683,0.001443693,-0.013294443,0.001412535,0.013211353,-0.01213118,-0.002118802,0.017781317,-0.007353489,-0.031075761,-0.004923099,0.011383367,-0.004486875,-0.010178559,0.016618054,0.014457707,0.023763817,-0.02459472,-0.00388447,0.012546631,-0.007519669,0.015704062,-0.014291527,0.009680017,-0.035562634,0.023763817,0.053510133,-0.0555043,-0.003572882,0.022102011,0.021603471,-0.017282777,-0.001474852,-0.043539301,0.007810486,-0.025757983,-0.005400868,0.029912498,-0.00760276,0.014125346,0.030909581,-0.03340229,-0.009680017,0.018030589,0.008849114,0.03057722,0.019775484,0.014125346,0.031906664,-0.03057722,-0.027087428,-0.023597637,-0.022434372,-0.012878992,0.016285693,-0.021603471,-0.029746316,0.029746316,0.020357117,0.006314861,-0.001158071,0.028749233,-0.045201108,0.011383367,0.011134096,-0.021437289,-0.035728816,0.001827986,0.008267482,-0.057498466,0.01213118,-0.01213118,-0.040548053,0.010718645,0.004798463,-0.004881553,-0.019526213,-0.008558298,0.0059825,-0.000262254,-0.017615138,0.005193142,0.019692395,-0.00198378,-0.002845842,0.012546631,0.006107135,-0.008225936,-0.008890659,0.015870241,0.00517237,0.002596571,-0.010427829,-0.019110762,0.024262359,0.012048089,-0.032405205,0.006522586,0.013211353,0.013211353,-0.038221523,-0.007727395,-0.008267482,-0.019276943,0.001474852,0.031408124,-0.035562634,0.017532047,-0.023431456,-0.015454791,-0.011383367,0.016534964,-0.02176965,0.008682934,0.027253609,0.020190936,-0.0247609,-0.007311944,0.009555381,-0.01852913,-0.011632638,0.011549547,0.027419789,-0.034067012,-0.01229736,0.0307434,0.003946788,0.0046946,0.037722982,0.03057722,-0.010427829,0.002284982,0.033236109,0.030078677,-0.013377533,0.007395034,-0.012048089,0.040714234,-0.028749233,-0.000102565,-0.0059825,-0.041046593,0.017698228,-0.006356406,0.003178203,0.009056839,0.023099095,0.00606559,0.011881908,-0.02127111,-0.001126912,-0.027087428,0.011134096,0.001204809,-0.017033506,0.011051006,-0.014374617,0.017864408,0.023431456,-0.002077257,-0.026755067,-0.043871664,0.025757983,-0.006190225,0.001152877,0.011798819,-0.024262359,0.006564131,-0.070128188,-0.004362239,0.012962082,-0.013626805,-0.001402148,-0.012214269,0.011217186,-0.015953332,0.015787151,0.011134096,0.027253609,0.024262359,-0.048192356,0.009970833,0.018944582,-0.00517237,0.021935832,0.02775215,0.003406701,-0.010884825,0.075113602,-0.015953332,0.007727395,0.026755067,-0.006190225,-0.012712811,0.013377533,0.005940954,-0.008309027,0.02459472,0.002316141,-0.022434372,-0.012712811,0.03057722,-0.015787151,0.026755067,-0.001069787,0.03988333,-0.003697517,0.039550968,-0.019027673,-0.0059825,-0.00031029,-0.012546631,-0.003614427,0.007478124,0.005525503,0.032571387,-0.011798819,-0.011466458,-0.00606559,-0.011798819,0.018446039,0.007976666,0.018944582,-0.02176965,0.026588887,-0.006273315,-0.012463541,-0.007395034,0.012048089,-0.029247776,0.015454791,-0.007145763,0.006481041,-0.015620971,-0.00388447,-0.025757983,-0.001651419,-0.032903746,-0.005068507,0.03938479,0.003926015,0.004715373,0.022600554,-0.012546631,0.022932915,0.007810486,0.040714234,0.019941665,0.013543714,0.003406701,0.010884825,-0.03988333,0.042209856,-0.022766734,0.027419789,-0.029580137,0.043206941,0.022932915,0.021104928,-0.056833744,0.005193142,0.036061179,-0.012878992,0.008516753,-0.02758597,-0.030244859,-0.011798819,0.001111332,-0.014125346,-0.014125346,0.019027673,0.029081594,0.018861491,0.013626805,0.06846638,0.023099095,0.041378956,0.001599488,-0.028749233,0.017781317,0.016285693,0.021603471,-0.018113678,0.011300277,-0.032239024,0.022434372,-0.02459472,-0.013626805,0.005483958,0.013460624,-0.031574301,-0.015620971,0.016451873,0.014790068,-0.008849114,0.011134096,0.00461151,0.015122429,0.036227357,0.00206687,0.000877641,0.022102011,-0.028250692,0.022600554,-0.026422706,0.004029878,-0.032072846,0.017116595,0.010884825,0.019609304,0.00614868,0.005733229,0.016119512,0.002866614,-0.014540797,0.012463541,-0.003905243,0.003759835,-0.000485559,-0.022766734,-0.016285693,0.037722982,0.009513836,0.001506011,0.011964999,0.004029878,0.019941665,-0.000965924,0.002129188,0.015205519,0.071125269,0.022932915,0.005940954,-0.00044661,0.010220103,-0.03423319,-0.016285693,-0.016867325,-0.000659529,-0.008018211,-0.011383367,0.000016634,0.004071423,-0.029413955,0.019941665,-0.00913993,-0.024096178,0.010635555,0.010594009,0.001547556,0.036227357,-0.030078677,0.020772567,0.022268193,-0.014125346,0.008766023,-0.012962082,-0.007187308,0.017033506,-0.007187308,-0.015205519,-0.005608593,0.044536386,-0.001235968,0.007852031,0.001599488,0.005857864,-0.005940954,-0.010510919,-0.005567048,0.006730312,0.016285693,-0.010801735,-0.024428539,0.015122429,-0.02176965,0.01528861,-0.007436579,0.00226421,-0.004715373,0.004507647,0.004341467,0.005525503,-0.031075761,-0.005899409,0.037556801,0.014873158,-0.000342747,0.009970833,-0.019443123,0.023597637,-0.012048089,-0.025259443,0.006024044,-0.01827986,0.010012378,0.016784234,0.013211353,-0.005400868,-0.024428539,-0.02176965,-0.035230275,0.009347656,0.028583053,-0.015704062,-0.017781317,0.00226421,0.001199616,-0.003385928,0.008267482,0.002326528,0.022434372,-0.020190936,-0.015787151,0.000789358,0.031241942,0.011300277,0.001506011,-0.023265276,-0.010967916,0.009056839,0.011300277,-0.030244859,0.007478124,0.001111332,-0.035894997,0.0153717,0.002700434,0.021104928,0.010884825,-0.003344383,0.00768585,0.010386284,0.00452842,-0.014706978,0.028084511,0.013377533,0.014873158,0.046862911,-0.015454791,0.021188019,0.013959166,0.012629721,0.025924165,-0.018695312,-0.00922302,-0.0093892,0.007727395,0.036892079,0.007228854,-0.01229736,0.029247776,-0.004943871,-0.027253609,-0.008433662,0.043206941,0.002825069,0.028583053,-0.023431456,0.034897912,-0.041545134,-0.016534964,0.003053567,-0.012712811,0.002741979,-0.007187308,-0.025093261,-0.045201108,-0.004424557,-0.016618054,-0.008890659,0.008018211,-0.05184833,-0.019526213,-0.013377533,-0.010469374,0.030244859,-0.005068507,0.051183607,0.005483958,-0.006024044,0.035064094,-0.011134096,0.014956249,0.002284982,0.001724123,-0.01229736,0.012629721,0.010261648,0.014540797,0.048857078,-0.029580137,-0.024927082,-0.008350573,-0.03988333,0.000939959,0.013543714,0.013626805,-0.021437289,-0.012962082,0.006771857,0.013709894,-0.0059825,0.035396457,-0.006439496,-0.029580137,0.0046946,0.019609304,-0.007270399,0.014291527,-0.015620971,0.00118923,-0.00760276,-0.017199686,0.023265276,0.026588887,-0.030078677,-0.016701145,-0.025757983,0.004964644,0.026588887,0.043206941,0.011051006,-0.009846197,0.028915415,0.031574301,0.023763817,0.009264565,-0.008433662,-0.035064094,-0.000579035,-0.0247609,0.014125346,0.016618054,0.028749233,-0.052513052,-0.016867325,-0.01238045,0.002741979,0.013709894,0.010718645,0.013626805,0.009596926,-0.004403784,-0.02758597,-0.000945152,0.000420645,0.003759835,0.012546631,-0.011881908,0.008392117,0.012795902,0.005483958,-0.009763107,0.006397951,-0.010801735,0.012795902,-0.03938479,0.005733229,0.005733229,-0.000433627,0.015454791,0.002357686,-0.006564131,0.030244859,-0.024428539,0.016036423,0.014291527,-0.004964644,0.029413955,0.040381871,0.012629721,-0.033568468,-0.026422706,-0.037889164,-0.034399372,-0.03423319,0.021935832,0.004133741,-0.014623888,-0.013543714,-0.05517194,0.004736145,0.006314861,0.00006037,0.006356406,0.003323611,-0.010344739,0.007062673,0.005899409,-0.00623177,-0.001973394,-0.0555043,0.011881908,0.001350217,-0.033069927,-0.026921248,0.022268193,0.028583053,-0.021021837,0.010884825,0.019692395,-0.005442413,0.031574301,-0.014956249,0.01238045,-0.006356406,0.006273315,-0.003095113,-0.014540797,-0.02176965,0.005006189,-0.002658889,0.042542219,-0.02176965,0.017199686,-0.016701145,-0.001599488,0.016950415,-0.021188019,0.017864408,0.023763817,-0.000669915,0.025093261,0.021104928,0.008807569,0.037390623,-0.025591804,-0.003178203,-0.001319058,0.020523297,0.005255459,0.019276943,-0.00226421,0.00760276,-0.057166107,-0.006896493,-0.034067012,0.043871664,0.038221523,0.008101301,0.03988333,0.015870241,0.000955538,-0.004299921,-0.002928932,-0.002118802,-0.020523297,-0.001168457,-0.011134096,-0.000685495,0.003323611,0.011549547,0.034565553,0.029247776,-0.029746316,0.005213914,0.019110762,-0.003302838,0.026422706,0.028915415,-0.036227357,0.033236109,0.038387705,-0.035230275,0.004071423,-0.021935832,0.002928932,0.000976311,0.000527104,-0.006854947,-0.003822153,-0.001199616,0.019858574,-0.002762751,0.039052427,-0.008641388,0.032239024,-0.002295369,0.035396457,0.044536386,-0.029413955,0.025093261,-0.03423319,-0.016867325,-0.008849114,0.008433662,-0.004486875,0.017033506,0.006730312,-0.008599843,-0.008225936,-0.024428539,0.006564131,-0.007561215,-0.032072846,-0.019941665,0.035396457,0.019276943,0.010261648,0.005857864,0.032239024,-0.044204023,-0.018944582,0.002409618,0.032903746,0.05517194,-0.03655972,0.007976666,0.030909581,-0.023929998,0.016368784,0.01528861,-0.00768585,0.02176965,0.013626805,-0.02459472,0.04021569,-0.032737568,0.006854947,-0.011383367,0.014873158,-0.02176965,0.00243039,0.0093892,0.0093892,-0.029580137,0.019858574,0.01827986,0.024428539,0.017864408,-0.028250692,-0.001111332,0.056169022,0.007478124,-0.010718645,0.041046593,-0.015704062,0.034731735,0.002523867,-0.032571387,0.004341467,-0.023597637,-0.011881908,-0.035562634,0.006688767,0.007810486,-0.012712811,0.022600554,0.03057722,0.022600554,0.010552464,0.0307434,-0.009638472,0.02176965,-0.018030589,0.024262359,-0.036227357,-0.020772567,0.001641033,-0.022932915,-0.014623888,0.018362951,0.002575798,0.006190225,-0.011051006,0.021021837,0.019110762,0.02127111,-0.028583053,-0.052180689,-0.014291527,-0.010552464,0.036393538,0.042542219,-0.04586583,-0.001869531,0.008350573,-0.008516753,-0.020772567,0.000294711,0.015704062,-0.014457707,-0.020772567,0.008766023,-0.026588887,-0.004736145,-0.028084511,-0.007519669,0.010552464,-0.016534964,0.006190225,0.012962082,-0.016618054,0.012546631,0.02459472,0.022932915,0.020440206,-0.027918331,-0.008059756,0.020689478,-0.014623888,-0.011466458,-0.006896493,-0.020024756,-0.031408124,0.021603471,0.007270399,-0.03057722,0.008350573,-0.021437289,0.00072704,-0.043871664,0.006314861,-0.017199686,0.02176965,0.024262359,-0.020357117,-0.000542683,-0.005213914,0.001963008,-0.00064395,-0.022434372,0.022102011,-0.006688767,-0.028583053,0.002191506,-0.005047734,0.002368073,0.014956249,0.023929998,-0.003302838,-0.032239024,0.022268193,-0.013377533,-0.010801735,0.003676744,0.009015295,-0.039550968,0.010884825,-0.033568468,0.013709894,-0.029413955,-0.006356406,-0.020274026,0.023597637,0.030909581,0.02176965,0.016285693,0.045533467,-0.024096178,-0.030909581,-0.026422706,0.002783524,-0.010594009,0.004362239,-0.070792913,0.009472291,-0.022102011,0.011134096,-0.017448956,-0.011549547,-0.056833744,0.00082571,0.026588887,-0.013709894,0.002575798,0.02176965,-0.000568649,-0.007270399,0.004279149,-0.042874578,-0.026588887,0.016784234,0.036725901,-0.028915415,-0.009513836,0.017448956,0.002035712,-0.007228854,0.011383367,0.011134096,0.028915415,0.0153717,-0.027087428,0.043871664,-0.005089279,0.006314861,0.014291527,-0.003240521,0.025924165,-0.001230775,-0.015454791,-0.012629721,0.031740483,-0.039717149,-0.031075761,0.006605676,-0.008641388,-0.032239024,0.037722982,-0.03705826,-0.024096178,0.001911076,0.018196769,-0.007353489,-0.011300277,-0.029081594,0.004590738,-0.018030589,-0.026588887,0.010261648,0.038221523,0.008392117,-0.01213118,0.018362951,-0.034731735,-0.017781317,-0.011632638,0.005255459,0.000851675,0.014208436,-0.000039922,-0.000228498,0.014790068,0.00913993,0.0004544,-0.011798819,-0.020440206,0.005899409,0.008350573,0.006314861,0.040548053,0.003427474,-0.010801735,0.008599843,0.002586185,-0.041212775,-0.016368784,0.020024756,0.000965924,-0.021021837,-0.008475208,0.0307434,0.00760276,0.003614427,0.003489791,-0.025924165,0.000799744,0.013460624,-0.020440206,0.048857078,0.004320694,-0.048857078,0.015039339,-0.029580137,0.025924165,0.018861491,-0.014706978,0.000576439,-0.031241942,0.0307434,0.0153717,0.014706978,0.028084511,-0.01238045,-0.031241942,0.018196769,-0.034897912,0.008142847,0.010718645,0.00922302,0.047859997,-0.00072704,-0.010427829,0.007104218,0.026256526,0.012214269,-0.013377533,-0.05184833,0.005276232,0.021935832,-0.007021128,0.009804652,0.007893575,0.024096178,-0.002357686,0.033900831,-0.031740483,0.034565553,-0.036892079,-0.015454791,0.030411039,0.010552464,-0.022268193,-0.001391762,-0.008184392,-0.008558298,0.008475208,-0.009929287,0.010427829,0.041378956,-0.009555381,-0.008724478,-0.039052427,0.034731735,-0.014291527,0.023099095,0.029081594,0.007519669,0.010967916,-0.008142847,0.006190225,-0.031075761,0.033734649,-0.001672192,0.047859997,-0.022434372,-0.007395034,0.01213118,0.056169022,0.002762751,-0.029413955,-0.000763392,-0.015787151,0.010801735,0.008142847,0.029912498,-0.0018176,0.033236109,-0.046198189,-0.002492708,-0.006730312,0.008807569,-0.03655972,0.009430746,-0.053842496,-0.060489718,0.046862911,0.002783524,-0.0187784,0.000571246,0.00760276,0.002482322,0.001319058,-0.014291527,0.001464466,-0.011632638,-0.012463541,-0.004902326,0.000841289,0.006688767,0.030244859,0.018944582,0.000532297,-0.015620971,0.007104218,0.005608593,0.002035712,-0.023763817,0.003032795,0.010594009,-0.023597637,-0.042376038,-0.005255459,0.001199616,-0.0247609,-0.007893575,-0.011632638,0.013045172,-0.005691683,-0.007104218,0.027419789,-0.004320694,-0.005525503,-0.026090344,0.031408124,-0.012795902,-0.007062673,0.000939959,0.000030185,0.004175286,0.014291527,0.033236109,-0.038720068,0.074116521,-0.019692395,0.001589101,0.013792985,-0.056169022,-0.028749233,-0.001599488,0.004175286,0.014790068,0.00162026,-0.007519669,-0.041378956,0.016534964,-0.003572882,-0.002575798,-0.019526213,-0.00922302,-0.033900831,-0.042043675,-0.014208436,0.010178559,0.017698228,0.032239024,0.00913993,0.009264565,-0.012463541,-0.005857864,-0.015870241,0.004486875,0.018861491,-0.000176567,-0.029912498,0.016784234,0.012546631,0.051183607,0.023597637,0.032903746,0.0153717,-0.013377533,-0.000016634,-0.061486799,-0.034565553,0.016119512,0.00380138,-0.003863698,0.004362239,-0.017532047,-0.002762751,0.000102565,-0.021437289,0.029247776,-0.010718645,-0.015870241,-0.016285693,0.010220103,-0.000373906,0.012962082,0.010137013,-0.007228854,0.02127111,-0.029247776,0.018113678,0.009181475,0.002233051,0.014374617,-0.00396756,0.010801735,0.007644305,0.020855658,0.014790068,0.032737568,-0.037390623,0.003032795,0.010801735,-0.01553788,-0.014790068,0.019526213,-0.017947499,-0.007893575,-0.011964999,-0.00614868,-0.005857864,-0.032072846,-0.025924165,0.001163264,-0.013294443,-0.01553788,0.016701145,-0.013460624,-0.001111332,0.00760276,0.01553788,-0.033734649,0.048192356,-0.003282066,0.031906664,0.002845842,0.003240521,0.017116595,-0.01827986,0.006896493,-0.00760276,-0.009680017,-0.02459472,-0.020689478,-0.053510133,0.00614868,-0.010552464,-0.032405205,-0.0307434,0.025093261,0.003635199,-0.008101301,-0.00606559,-0.007436579,0.00606559,-0.012962082,0.026921248,0.009098385,0.046530552,-0.011632638,0.032571387,-0.033900831,0.009846197,0.002866614,0.032903746,0.008973749,0.012712811,0.040049512,0.013626805,-0.026256526,-0.031408124,0.036227357,0.011964999,-0.006024044,-0.001848759,0.015704062,-0.021188019,-0.035064094,-0.013377533,-0.009721561,-0.01553788,0.008766023,0.005400868,0.004507647,-0.018362951,-0.026588887,-0.00913993,-0.025591804,0.035894997,0.021935832,-0.031906664,-0.000602404,0.026422706,-0.006397951,0.006647222,0.0093892,0.020606387,0.00913993,0.015620971,-0.024096178,0.00063616,-0.006564131,0.01238045,-0.013709894,0.000563456,-0.009887742,0.016618054,-0.003323611,0.000451803,0.001609874,0.008682934,0.025259443,0.020024756,-0.027253609,0.010884825,0.028250692,-0.054839578,0.033568468,-0.004902326,0.003053567,0.020274026,-0.015704062,-0.00614868,-0.063813329,0.002482322,0.009763107,-0.001609874,-0.012214269,0.020107845,0.001921462,0.018695312,-0.004923099,0.007270399,-0.023763817,0.005234687,0.003406701,0.002565412,0.007104218,0.000841289,0.016202603,0.01827986,-0.031075761,-0.035562634,-0.025259443,-0.007021128,0.000641353,-0.033069927,0.010718645,0.005650138,0.024927082,-0.002658889,0.00380138,0.009929287,-0.004258377,-0.039717149,-0.022434372,0.025425622,0.00198378,0.006356406,0.017615138,-0.032072846,0.046862911,-0.026921248,0.005940954,0.021603471,-0.002253824,0.002825069,-0.030411039,-0.003115885,0.023597637,-0.004320694,-0.007852031,0.018030589,-0.008724478,-0.005733229,0.032903746,0.013876075,0.015454791,-0.023597637,0.005151597,-0.035396457,0.02176965,-0.012463541,0.025591804,0.014540797,-0.027918331,0.004154514,0.008724478,0.016036423,-0.015870241,0.005400868,-0.017365867,-0.044868745,-0.000485559,0.020357117,-0.00760276,-0.023265276,-0.012048089,0.008433662,0.018362951,-0.006979583,0.0307434,0.008392117,0.027087428,-0.019360034,0.016119512,0.02127111,0.010801735,0.00299125,0.002949705,0.012463541,-0.000025966,0.015953332,0.029413955,0.020024756,0.003780607,0.022102011,-0.031740483,0.01553788,0.010386284,0.028749233,-0.010884825,0.008682934,-0.003531337,-0.05517194,-0.019360034,-0.009347656,-0.002025325,0.003261293,-0.025425622,-0.01553788,-0.000251867,0.014291527,0.012546631,0.035728816,-0.007062673,-0.006605676,0.000384293,-0.005047734,-0.032571387,-0.021188019,-0.02127111,-0.016036423,0.008475208,-0.004009106,0.014291527,-0.008101301,0.004424557,-0.038221523,-0.019360034,0.015039339,-0.015454791,-0.029580137,0.035728816,0.004466102,-0.000778971,-0.005068507,-0.017781317,0.00477769,0.001838372,0.030244859,0.01213118,-0.022932915,-0.005359322,0.037390623,0.005899409,0.002046098,0.037889164,0.016701145,0.010303194,0.02127111,-0.009513836,-0.022268193,-0.005650138,-0.00388447,0.016534964,-0.023265276,-0.00054528,0.004819236,0.004715373,-0.001178843,-0.051183607,-0.00614868,-0.010552464,-0.002741979,-0.009181475,0.023597637,0.019193852,0.017199686,-0.036393538,-0.00243039,-0.015870241,-0.014706978,-0.00145408,0.016368784,-0.011632638,-0.014623888,-0.01229736,-0.01553788,0.040880412,0.023929998,-0.014623888,0.002648502,0.031906664,-0.033734649,-0.026755067,0.002783524,0.005359322,0.009970833,0.001412535,0.016950415,0.016285693,-0.006730312,-0.02459472,0.050851244,-0.001827986,-0.020855658,0.020938748,0.004071423,-0.021603471,-0.007852031,-0.023929998,-0.029912498,-0.003365156,0.017365867,-0.010427829,-0.011715728,0.014956249,0.011383367,0.032405205,-0.028583053,-0.017448956,0.018446039,0.017615138,0.035728816,-0.010095468,-0.00254464,0.010012378,0.028250692,-0.020855658,-0.002305755,-0.001002276,-0.014125346,-0.007021128,-0.028583053,-0.045533467,-0.02758597,-0.020440206,0.001350217,0.010053922,0.020689478,-0.017615138,0.026422706,0.040880412,0.012463541,-0.010718645,-0.014706978,0.068134025,0.038720068,0.047859997,-0.012546631,0.015704062,-0.002087643,-0.010303194,0.014790068,0.018612221,0.007395034,-0.014790068,-0.017864408,-0.005068507,-0.054507218,0.004902326,-0.004050651,0.021603471,0.019775484,-0.024262359,-0.012795902,0.021935832,-0.004009106,-0.039717149,0.037556801,-0.016701145,-0.025757983,0.005483958,-0.005110051,-0.021935832,-0.003406701,0.010594009,0.015787151,-0.049854163,0.007727395,-0.008392117,-0.017199686,0.009970833,-0.008849114,-0.013876075,-0.0059825,-0.015870241,-0.007104218,0.028250692,-0.029081594,0.026921248,0.00299125,-0.017781317,0.042542219,0.018196769,0.052845411,-0.004819236,-0.014125346,0.02459472,-0.011715728,0.015787151,-0.005774774,0.004902326,-0.004964644,-0.02758597,-0.013959166,-0.033568468,-0.027918331,-0.017698228,0.003489791,-0.020024756,-0.021603471,0.019360034,0.028084511,-0.002503094,-0.018861491,-0.002295369,0.050851244,-0.020689478,-0.000459593,-0.026090344,0.002783524,-0.005899409,-0.026921248,-0.0093892,-0.004112968,0.031574301,0.003926015,-0.032903746,-0.046198189,-0.019027673,-0.00913993,0.030411039,-0.019443123,0.001963008,-0.005193142,0.010884825,-0.02127111,-0.025259443,0.032737568,0.00089322,0.003282066,0.001713737,-0.006439496,0.016867325,-0.031574301,0.031075761,-0.009970833,0.022600554,-0.023597637,-0.014956249,0.004009106,0.00198378,0.026588887,-0.023431456,-0.023763817,-0.013294443,-0.029746316,0.001381376,-0.042874578,-0.00913993,0.014873158,0.016202603,0.012878992,-0.006024044,0.009638472,0.010552464,-0.017033506,-0.027087428,0.044536386,-0.038055345,0.001329444,-0.019609304,0.023597637,-0.043206941,0.040049512,0.017615138,0.046862911,0.02127111,0.013294443,-0.039550968,-0.018861491,-0.019609304,-0.033734649,0.00623177,-0.017199686,0.041212775,-0.017781317,-0.024262359,0.054507218,-0.009721561,0.005816319,-0.00206687,-0.008766023,0.017365867,-0.000737426,0.018362951,-0.023597637,-0.019110762,0.021935832,0.041545134,-0.020357117,-0.017615138,0.044868745,-0.018030589,-0.032405205,-0.050186522,-0.014540797,0.005213914,-0.006688767,0.047527634,0.040714234], + "numCandidates": 150, + "limit": 10, + "quantization": "scalar" + } + }, + { + "$project": { + "_id": 0, + "plot": 1, + "title": 1, + "score": { $meta: "vectorSearchScore" } + } + } +]); +EOF +) + +kubectl exec --context "${K8S_CTX}" -n "${MDB_NS}" mongodb-tools-pod -- /bin/bash -eu -c "$(cat < /tmp/mdb_script.js +mongosh --quiet "${MDB_CONNECTION_STRING}" < /tmp/mdb_script.js +EOF +)" diff --git a/docs/search/03-search-query-usage/code_snippets/03_9010_delete_namespace.sh b/docs/search/03-search-query-usage/code_snippets/03_9010_delete_namespace.sh new file mode 100755 index 000000000..2d28e4bb7 --- /dev/null +++ b/docs/search/03-search-query-usage/code_snippets/03_9010_delete_namespace.sh @@ -0,0 +1 @@ +kubectl --context "${K8S_CTX}" delete namespace "${MDB_NS}" diff --git a/docs/search/03-search-query-usage/env_variables.sh b/docs/search/03-search-query-usage/env_variables.sh new file mode 100644 index 000000000..af6bd874c --- /dev/null +++ b/docs/search/03-search-query-usage/env_variables.sh @@ -0,0 +1,20 @@ +# The env vars here are all commented out because this snippets module +# is reusable across different MongoDB deployments and all the necessary variables +# should be already defined there. + +# set it to the context name of the k8s cluster +#export K8S_CTX="" +# the following namespace will be used to deploy mongodb tools pod +#export MDB_NS="mongodb" + +# regular user performing restore and search queries on sample mflix database +# the user should be able to restore database using mongorestore +#export MDB_USER_PASSWORD="mdb-user-password-CHANGE-ME" + +# name of MongoDB or MongoDBCommunity resource in case it's deployed in the same cluster +# user only for the connection string in MDB_CONNECTION_STRING env var below +#export MDB_RESOURCE_NAME="mdbc-rs" + +# default connection string if MongoDB database is deployed using the operator +#export MDB_CONNECTION_STRING="mongodb://mdb-user:${MDB_USER_PASSWORD}@${MDB_RESOURCE_NAME}-0.${MDB_RESOURCE_NAME}-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=${MDB_RESOURCE_NAME}" + diff --git a/docs/search/03-search-query-usage/output/03_0420_import_movies_mflix_database.out b/docs/search/03-search-query-usage/output/03_0420_import_movies_mflix_database.out new file mode 100644 index 000000000..a7432faf0 --- /dev/null +++ b/docs/search/03-search-query-usage/output/03_0420_import_movies_mflix_database.out @@ -0,0 +1,2 @@ +Downloading sample database archive... +Restoring sample database diff --git a/docs/search/03-search-query-usage/output/03_0440_wait_for_search_index_ready.out b/docs/search/03-search-query-usage/output/03_0440_wait_for_search_index_ready.out new file mode 100644 index 000000000..b264580af --- /dev/null +++ b/docs/search/03-search-query-usage/output/03_0440_wait_for_search_index_ready.out @@ -0,0 +1 @@ +Sleeping to wait for search indexes to be created diff --git a/docs/search/03-search-query-usage/output/03_0444_list_search_indexes.out b/docs/search/03-search-query-usage/output/03_0444_list_search_indexes.out new file mode 100644 index 000000000..d236b3b7c --- /dev/null +++ b/docs/search/03-search-query-usage/output/03_0444_list_search_indexes.out @@ -0,0 +1,32 @@ +{ + cursor: { + id: 0, + ns: 'sample_mflix.movies', + firstBatch: [ + { + id: '68ba080ea2d54a79efca0bcc', + name: 'default', + type: 'search', + latestDefinition: { + indexID: ObjectId('68ba080ea2d54a79efca0bcc'), + name: 'default', + database: 'sample_mflix', + lastObservedCollectionName: 'movies', + collectionUUID: UUID('1946f612-6643-42ee-b3fe-a8c70dcb6c8f'), + numPartitions: 1, + mappings: { dynamic: true, fields: {} }, + indexFeatureVersion: 3 + } + } + ] + }, + ok: 1, + '$clusterTime': { + clusterTime: Timestamp({ t: 1757022273, i: 7 }), + signature: { + hash: Binary.createFromBase64('kdWxyz35pdSme00nFy6jvg0fMQ0=', 0), + keyId: Long('7546352109956890629') + } + }, + operationTime: Timestamp({ t: 1757022273, i: 7 }) +} diff --git a/docs/search/03-search-query-usage/output/03_0445_list_vector_search_indexes.out b/docs/search/03-search-query-usage/output/03_0445_list_vector_search_indexes.out new file mode 100644 index 000000000..e7c92f46e --- /dev/null +++ b/docs/search/03-search-query-usage/output/03_0445_list_vector_search_indexes.out @@ -0,0 +1,40 @@ +{ + cursor: { + id: 0, + ns: 'sample_mflix.embedded_movies', + firstBatch: [ + { + id: '68ba080ea2d54a79efca0bcd', + name: 'vector_index', + type: 'vectorSearch', + latestDefinition: { + type: 'vectorSearch', + indexID: ObjectId('68ba080ea2d54a79efca0bcd'), + name: 'vector_index', + database: 'sample_mflix', + lastObservedCollectionName: 'embedded_movies', + collectionUUID: UUID('cf7c49d4-6299-4da8-a36c-a5a2017c3077'), + numPartitions: 1, + fields: [ + { + type: 'vector', + path: 'plot_embedding_voyage_3_large', + numDimensions: 2048, + similarity: 'dotProduct', + quantization: 'scalar' + } + ] + } + } + ] + }, + ok: 1, + '$clusterTime': { + clusterTime: Timestamp({ t: 1757022273, i: 7 }), + signature: { + hash: Binary.createFromBase64('kdWxyz35pdSme00nFy6jvg0fMQ0=', 0), + keyId: Long('7546352109956890629') + } + }, + operationTime: Timestamp({ t: 1757022273, i: 7 }) +} diff --git a/docs/search/03-search-query-usage/output/03_0450_execute_search_query.out b/docs/search/03-search-query-usage/output/03_0450_execute_search_query.out new file mode 100644 index 000000000..f425a96d8 --- /dev/null +++ b/docs/search/03-search-query-usage/output/03_0450_execute_search_query.out @@ -0,0 +1,22 @@ +mdb-rs [primary] test> switched to db sample_mflix +mdb-rs [primary] sample_mflix> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... [ + { + plot: 'A sports agent stages an unconventional recruitment strategy to get talented Indian cricket players to play Major League Baseball.', + genres: [ 'Biography', 'Drama', 'Sport' ], + title: 'Million Dollar Arm', + released: ISODate('2014-05-16T00:00:00.000Z') + }, + { + plot: 'A Taiwanese high school baseball team travels to Japan in 1931 to compete in a national tournament.', + genres: [ 'Biography', 'Drama', 'History' ], + title: 'Kano', + released: ISODate('2014-02-27T00:00:00.000Z') + }, + { + plot: "12-year-old Josh is a mixed race boy and a promising baseball player. He is abused by his mother's boyfriend Byrd, and neglected by his mother Debbie. He forges his own path in life when ...", + genres: [ 'Drama' ], + title: 'Calloused Hands', + released: ISODate('2013-03-03T00:00:00.000Z') + } +] +mdb-rs [primary] sample_mflix> \ No newline at end of file diff --git a/docs/search/03-search-query-usage/output/03_0455_execute_vector_search_query.out b/docs/search/03-search-query-usage/output/03_0455_execute_vector_search_query.out new file mode 100644 index 000000000..1623a6fdc --- /dev/null +++ b/docs/search/03-search-query-usage/output/03_0455_execute_vector_search_query.out @@ -0,0 +1,54 @@ +mdb-rs [primary] test> switched to db sample_mflix +mdb-rs [primary] sample_mflix> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... [ + { + plot: 'At the age of 21, Tim discovers he can travel in time and change what happens and has happened in his own life. His decision to make his world a better place by getting a girlfriend turns out not to be as easy as you might think.', + title: 'About Time', + score: 0.7704131603240967 + }, + { + plot: 'A psychiatrist makes multiple trips through time to save a woman that was murdered by her brutal husband.', + title: 'Retroactive', + score: 0.7597770690917969 + }, + { + plot: 'An officer for a security agency that regulates time travel, must fend for his life against a shady politician who has a tie to his past.', + title: 'Timecop', + score: 0.7574796676635742 + }, + { + plot: 'A time-travel experiment in which a robot probe is sent from the year 2073 to the year 1973 goes terribly wrong thrusting one of the project scientists, a man named Nicholas Sinclair into a...', + title: 'A.P.E.X.', + score: 0.7573235034942627 + }, + { + plot: 'After visiting 2015, Marty McFly must repeat his visit to 1955 to prevent disastrous changes to 1985... without interfering with his first trip.', + title: 'Back to the Future Part II', + score: 0.751945972442627 + }, + { + plot: 'A reporter, learning of time travelers visiting 20th century disasters, tries to change the history they know by averting upcoming disasters.', + title: 'Thrill Seekers', + score: 0.7503504753112793 + }, + { + plot: 'Hoping to alter the events of the past, a 19th century inventor instead travels 800,000 years into the future, where he finds humankind divided into two warring races.', + title: 'The Time Machine', + score: 0.750007152557373 + }, + { + plot: 'Lyle, a motorcycle champion is traveling the Mexican desert, when he find himself in the action radius of a time machine. So he find himself one century back in the past between rapists, ...', + title: 'Timerider: The Adventure of Lyle Swann', + score: 0.7499568462371826 + }, + { + plot: 'A romantic drama about a Chicago librarian with a gene that causes him to involuntarily time travel, and the complications it creates for his marriage.', + title: "The Time Traveler's Wife", + score: 0.7492842674255371 + }, + { + plot: 'A modern aircraft carrier is thrown back in time to 1941 near Hawaii, just hours before the Japanese attack on Pearl Harbor.', + title: 'The Final Countdown', + score: 0.7472751140594482 + } +] +mdb-rs [primary] sample_mflix> \ No newline at end of file diff --git a/docs/search/03-search-query-usage/test.sh b/docs/search/03-search-query-usage/test.sh new file mode 100755 index 000000000..28e430eb0 --- /dev/null +++ b/docs/search/03-search-query-usage/test.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -eou pipefail + +script_name=$(readlink -f "${BASH_SOURCE[0]}") +script_dir=$(dirname "${script_name}") + +source "${script_dir}/../../../scripts/code_snippets/sample_test_runner.sh" + +cd "${script_dir}" + +prepare_snippets + +run 03_0410_run_mongodb_tools_pod.sh +run_for_output 03_0420_import_movies_mflix_database.sh +run 03_0430_create_search_index.sh +run 03_0435_create_vector_search_index.sh +run_for_output 03_0440_wait_for_search_index_ready.sh +run_for_output 03_0444_list_search_indexes.sh +run_for_output 03_0445_list_vector_search_indexes.sh +run_for_output 03_0450_execute_search_query.sh +run_for_output 03_0455_execute_vector_search_query.sh + +cd - diff --git a/docs/search/04-search-external-mongod/README.md b/docs/search/04-search-external-mongod/README.md new file mode 100644 index 000000000..9d1f059c6 --- /dev/null +++ b/docs/search/04-search-external-mongod/README.md @@ -0,0 +1,547 @@ +# MongoDB Search with External MongoDB (No TLS) - Quick Start + +This guide shows how to deploy MongoDB Search in Kubernetes and connect it to an existing external MongoDB replica set +without TLS. The mongot component runs in the cluster, while the MongoDB replica set exists externally. + +## Prerequisites + +Before you begin, ensure you have the following tools and configurations in place: + +- **Kubernetes cluster**: A running Kubernetes cluster (e.g., Minikube, Kind, GKE, EKS, AKS) with kubeconfig available + locally. +- **kubectl**: The Kubernetes command-line tool, configured to communicate with your cluster. +- **Helm**: The package manager for Kubernetes, used here to install the MongoDB Kubernetes Operator. +- **Bash 5.1+**: All shell commands in this guide are intended to be run in Bash. Scripts in this guide are + automatically tested on Linux with Bash 5.1. +- **External MongoDB**: An existing MongoDB Community replica set (version 8.0.10 or higher) that will serve as the data + source for search. + +## Setup Steps + +The following steps guide you through deploying MongoDB Search to connect to your external MongoDB. Each step provides a +shell script. +**It is important to first source the `env_variables.sh` script provided and customize its values for your environment. +** +The subsequent script snippets rely on the environment variables defined in `env_variables.sh`. You should copy and +paste each script into your Bash terminal. + +### 1. Configure Environment Variables + +First, you need to set up your environment. The `env_variables.sh` script, shown below, contains variables for the +subsequent steps. You should create this file locally or use the linked one. + +Download or copy the content of `env_variables.sh`: +[env_variables.sh](env_variables.sh) + +```shell copy +# set it to the context name of the k8s cluster +export K8S_CTX="" + +# the following namespace will be created if not exists +export MDB_NS="mongodb" + +# minimum required MongoDB version for running MongoDB Search is 8.0.10 +export MDB_VERSION="8.0.10" + +# root admin user for convenience, not used here at all in this guide +export MDB_ADMIN_USER_PASSWORD="admin-user-password-CHANGE-ME" +# regular user performing restore and search queries on sample mflix database +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" + +# 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 +# In production, replace with your actual external MongoDB replica set members +export MDB_EXTERNAL_HOST_0="mdbc-rs-0.mdbc-rs-svc.${MDB_NS}.svc.cluster.local:27017" +export MDB_EXTERNAL_HOST_1="mdbc-rs-1.mdbc-rs-svc.${MDB_NS}.svc.cluster.local:27017" +export MDB_EXTERNAL_HOST_2="mdbc-rs-2.mdbc-rs-svc.${MDB_NS}.svc.cluster.local:27017" +# REPLACE with your external MongoDB keyfile secret name +export MDB_EXTERNAL_KEYFILE_SECRET_NAME="mdbc-rs-keyfile" +# REPLACE with the actual keyfile content from your external MongoDB replica set +# For testing, this will be automatically generated by the MongoDB Community resource +export MDB_EXTERNAL_KEYFILE_CONTENT="your-mongodb-keyfile-content-CHANGE-ME" +# REPLACE with your actual external MongoDB replica set name +export MDB_EXTERNAL_REPLICA_SET_NAME="mdbc-rs" + +export OPERATOR_HELM_CHART="mongodb/mongodb-kubernetes" +# comma-separated key=value pairs for additional parameters passed to the helm-chart installing the operator +export OPERATOR_ADDITIONAL_HELM_VALUES="" +``` + +This will load the variables into your current shell session, making them available for the commands in the following +steps. + +### 2. Add MongoDB Helm Repository + +First, add the MongoDB Helm repository. This repository contains the Helm chart required to install the MongoDB +Kubernetes Operator. The operator automates the deployment and management of MongoDB Search instances on Kubernetes. + +[code_snippets/090_helm_add_mogodb_repo.sh](code_snippets/090_helm_add_mogodb_repo.sh) + +```shell copy +helm repo add mongodb https://mongodb.github.io/helm-charts +helm repo update mongodb +helm search repo mongodb/mongodb-kubernetes +``` + +### 3. Install MongoDB Kubernetes Operator + +Next, install the MongoDB Kubernetes Operator from the Helm repository you just added. The Operator will watch for +MongoDBSearch custom resources and manage the lifecycle of your MongoDB Search deployments. + +[code_snippets/0100_install_operator.sh](code_snippets/0100_install_operator.sh) + +```shell copy +helm upgrade --install --debug --kube-context "${K8S_CTX}" \ + --create-namespace \ + --namespace="${MDB_NS}" \ + mongodb-kubernetes \ + --set "${OPERATOR_ADDITIONAL_HELM_VALUES:-"dummy=value"}" \ + "${OPERATOR_HELM_CHART}" +``` + +This command installs the operator in the `mongodb` namespace (creating it if it doesn't exist). + +## Deploying MongoDB Search + +With the prerequisites and initial setup complete, you can now deploy MongoDB Search to connect to your external +MongoDB. + +### 4. Create User Secrets + +MongoDB Search requires authentication credentials to connect to your external MongoDB, and you'll also need credentials +for testing the search functionality. This step creates Kubernetes secrets for all required passwords: the search +synchronization user, admin user, and regular user passwords that must exist in your external MongoDB. + +[code_snippets/04_0305_create_mongodb_community_user_secrets.sh](code_snippets/04_0305_create_mongodb_community_user_secrets.sh) + +```shell copy +kubectl --context "${K8S_CTX}" --namespace "${MDB_NS}" \ + create secret generic mdb-admin-user-password \ + --from-literal=password="${MDB_ADMIN_USER_PASSWORD}" + +kubectl --context "${K8S_CTX}" --namespace "${MDB_NS}" \ + create secret generic mdbc-rs-search-sync-source-password \ + --from-literal=password="${MDB_SEARCH_SYNC_USER_PASSWORD}" + +kubectl --context "${K8S_CTX}" --namespace "${MDB_NS}" \ + create secret generic mdb-user-password \ + --from-literal=password="${MDB_USER_PASSWORD}" +``` + +Ensure these secrets are created in the same namespace where you plan to deploy MongoDB Search. + +### 5. Create External MongoDB Keyfile Secret + +Your external MongoDB replica set uses a keyfile for internal authentication between replica set members. MongoDB Search +needs access to this same keyfile to authenticate with your external MongoDB. This step creates a Kubernetes secret +containing the keyfile content from your external MongoDB. + +**Important**: You must obtain the keyfile content from your external MongoDB replica set. This is typically a +base64-encoded string or the raw keyfile content used by your MongoDB instances. + +[code_snippets/04_0318_create_external_keyfile_secret.sh](code_snippets/04_0318_create_external_keyfile_secret.sh) + +```shell copy +kubectl --context "${K8S_CTX}" --namespace "${MDB_NS}" \ + create secret generic "${MDB_EXTERNAL_KEYFILE_SECRET_NAME}" \ + --from-literal=keyfile="${MDB_EXTERNAL_KEYFILE_CONTENT}" +``` + +**Note**: Make sure to set the `MDB_EXTERNAL_KEYFILE_CONTENT` environment variable to the exact keyfile content used by +your external MongoDB replica set. + +### 6. Create MongoDB Search Resource + +Deploy a `MongoDBSearch` resource named `mdbs` that connects to your external MongoDB replica set. The Search resource +lists the external replica set members under `spec.source.external.hostAndPorts` and uses the search synchronization +user credentials. TLS is disabled in this example. + +Note: Public Preview of MongoDB Community Search comes with some limitations, and it is not suitable for production use: + +* Only one instance of the search node is supported (load balancing is not supported) + +[code_snippets/0320_create_mongodb_search_resource.sh](code_snippets/0320_create_mongodb_search_resource.sh) + +```shell copy +kubectl apply --context "${K8S_CTX}" -n "${MDB_NS}" -f - <:` from any cluster node. + +**Ingress with TCP Support** + +```yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: search-ingress + annotations: + nginx.ingress.kubernetes.io/tcp-services-configmap: ${MDB_NS}/tcp-services +spec: +# Configure TCP passthrough for port 27027 +``` + +Requires an ingress controller that supports TCP services (like NGINX). + +**ClusterIP with Port Forwarding** (Development only) + +```bash +kubectl port-forward -n ${MDB_NS} svc/${MDB_SEARCH_HOSTNAME} 27027:27027 +``` + +Suitable for local development and testing only. + +### 8. Update CoreDNS Configuration for External Access + +When using external MongoDB instances, you need to configure DNS resolution so that the external MongoDB can resolve the +search service hostname. This step updates the CoreDNS configuration to map the search hostname to the LoadBalancer's +external IP address. + +[code_snippets/04_0323_update_coredns_configmap.sh](code_snippets/04_0323_update_coredns_configmap.sh) + +```shell copy +# Fetch the LoadBalancer external IP/hostname +SEARCH_IP=$(kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get svc "${MDB_SEARCH_HOSTNAME}" -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}') +fi + +if [ -z "${SEARCH_IP}" ]; then + echo "Error: Could not get LoadBalancer external IP/hostname for service ${MDB_SEARCH_HOSTNAME}" + exit 1 +fi + +echo "Using LoadBalancer external address: ${SEARCH_IP}" + +kubectl --context "${K8S_CTX}" -n kube-system apply -f - < /tmp/mdb_script.js +mongosh --quiet "mongodb://mdb-user:${MDB_USER_PASSWORD}@mdbc-rs-0.mdbc-rs-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=mdbc-rs" < /tmp/mdb_script.js +EOF +)" +``` diff --git a/docs/search/04-search-external-mongod/code_snippets/04_0045_create_namespaces.sh b/docs/search/04-search-external-mongod/code_snippets/04_0045_create_namespaces.sh new file mode 100644 index 000000000..076899281 --- /dev/null +++ b/docs/search/04-search-external-mongod/code_snippets/04_0045_create_namespaces.sh @@ -0,0 +1 @@ +kubectl --context "${K8S_CTX}" create namespace "${MDB_NS}" diff --git a/docs/search/04-search-external-mongod/code_snippets/04_0046_create_image_pull_secrets.sh b/docs/search/04-search-external-mongod/code_snippets/04_0046_create_image_pull_secrets.sh new file mode 100644 index 000000000..7158760c4 --- /dev/null +++ b/docs/search/04-search-external-mongod/code_snippets/04_0046_create_image_pull_secrets.sh @@ -0,0 +1,3 @@ +kubectl --context "${K8S_CTX}" -n "${MDB_NS}" \ + create secret generic "image-registries-secret" \ + --from-file=.dockerconfigjson="${HOME}/.docker/config.json" --type=kubernetes.io/dockerconfigjson diff --git a/docs/search/04-search-external-mongod/code_snippets/04_0048_configure_prerelease_image_pullsecret.sh b/docs/search/04-search-external-mongod/code_snippets/04_0048_configure_prerelease_image_pullsecret.sh new file mode 100644 index 000000000..4cb9ccd8a --- /dev/null +++ b/docs/search/04-search-external-mongod/code_snippets/04_0048_configure_prerelease_image_pullsecret.sh @@ -0,0 +1,11 @@ +if [[ "${PRERELEASE_IMAGE_PULLSECRET:-""}" == "" ]]; then return 0; fi + +kubectl apply --context "${K8S_CTX}" -n "${MDB_NS}" -f - </dev/null) + if [ -n "${EXTERNAL_IP}" ] && [ "${EXTERNAL_IP}" != "null" ]; then + echo "External IP assigned: ${EXTERNAL_IP}" + break + fi + echo "Still waiting for external IP assignment... (${ELAPSED}s/${TIMEOUT}s)" + sleep 5 + ELAPSED=$((ELAPSED + 5)) +done + +if [ ${ELAPSED} -ge ${TIMEOUT} ]; then + echo "ERROR: Timeout reached (${TIMEOUT}s) while waiting for external IP assignment" + echo "LoadBalancer service may take longer to provision or there may be an issue" + exit 1 +fi 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 new file mode 100644 index 000000000..c5f457101 --- /dev/null +++ b/docs/search/04-search-external-mongod/code_snippets/04_0323_update_coredns_configmap.sh @@ -0,0 +1,46 @@ +SEARCH_IP=$(kubectl --context "${K8S_CTX}" -n "${MDB_NS}" get svc "${MDB_SEARCH_HOSTNAME}" -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}') +fi + +if [ -z "${SEARCH_IP}" ]; then + echo "Error: Could not get LoadBalancer external IP/hostname for service ${MDB_SEARCH_HOSTNAME}" + exit 1 +fi + +echo "Using LoadBalancer external address: ${SEARCH_IP}" + +kubectl --context "${K8S_CTX}" -n kube-system apply -f - <>>>>>>> 6309cff6f (Refactor of existing snippets on master):scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out +LAST DEPLOYED: Mon Sep 1 19:22:18 2025 NAMESPACE: mongodb STATUS: deployed REVISION: 1 TEST SUITE: None USER-SUPPLIED VALUES: -<<<<<<<< HEAD:docs/community-search/quick-start/output/0100_install_operator.out -dummy: value -======== -agent: - version: 108.0.2.8729-1 -database: - name: mongodb-kubernetes-database - version: 68876175f5ad6d0007fdc1d4 -initAppDb: - version: 68876175f5ad6d0007fdc1d4 -initDatabase: - version: 68876175f5ad6d0007fdc1d4 -initOpsManager: - version: 68876175f5ad6d0007fdc1d4 -managedSecurityContext: false -mongodb: - imageType: ubi9 - name: mongodb-enterprise-server -operator: - enablePVCResize: true - maxConcurrentReconciles: 10 - mdbDefaultArchitecture: non-static - telemetry: - collection: - frequency: 1m - send: - enabled: false - version: 68876175f5ad6d0007fdc1d4 -opsManager: - name: mongodb-enterprise-ops-manager-ubi registry: - agent: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev - appDb: quay.io/mongodb - database: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev - imagePullSecrets: image-registries-secret - initAppDb: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev - initDatabase: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev - initOpsManager: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev - operator: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev - opsManager: quay.io/mongodb -search: - community: - name: mongot/community - repo: 268558157000.dkr.ecr.eu-west-1.amazonaws.com - version: fbd60fb055dd500058edcb45677ea85d19421f47 ->>>>>>>> 6309cff6f (Refactor of existing snippets on master):scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + imagePullSecrets: prerelease-image-pullsecret COMPUTED VALUES: agent: name: mongodb-agent - version: 108.0.2.8729-1 + version: 108.0.12.8846-1 community: agent: name: mongodb-agent @@ -88,21 +40,20 @@ community: version: 4.4.0 database: name: mongodb-kubernetes-database - version: 1.2.0 -dummy: value + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 initAppDb: name: mongodb-kubernetes-init-appdb - version: 1.2.0 + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 initDatabase: name: mongodb-kubernetes-init-database - version: 1.2.0 + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 initOpsManager: name: mongodb-kubernetes-init-ops-manager - version: 1.2.0 + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 managedSecurityContext: false mongodb: appdbAssumeOldFormat: false - imageType: ubi9 + imageType: ubi8 name: mongodb-enterprise-server repo: quay.io/mongodb multiCluster: @@ -120,7 +71,7 @@ operator: enableClusterMongoDBRoles: true enablePVCResize: true env: prod - maxConcurrentReconciles: 10 + maxConcurrentReconciles: 1 mdbDefaultArchitecture: non-static name: mongodb-kubernetes-operator nodeSelector: {} @@ -137,16 +88,15 @@ operator: collection: clusters: {} deployments: {} - frequency: 1m + frequency: 1h operators: {} send: - enabled: false frequency: 168h tolerations: [] vaultSecretBackend: enabled: false tlsSecretRef: "" - version: 1.2.0 + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 watchedResources: - mongodb - opsmanagers @@ -163,29 +113,22 @@ readinessProbe: version: 1.0.22 registry: agent: quay.io/mongodb - appDb: quay.io/mongodb - database: quay.io/mongodb - imagePullSecrets: null - initAppDb: quay.io/mongodb - initDatabase: quay.io/mongodb - initOpsManager: quay.io/mongodb - operator: quay.io/mongodb + appDb: quay.io/mongodb/staging + database: quay.io/mongodb/staging + imagePullSecrets: prerelease-image-pullsecret + initAppDb: quay.io/mongodb/staging + initDatabase: quay.io/mongodb/staging + initOpsManager: quay.io/mongodb/staging + operator: quay.io/mongodb/staging opsManager: quay.io/mongodb pullPolicy: Always readinessProbe: quay.io/mongodb versionUpgradeHook: quay.io/mongodb search: community: -<<<<<<<< HEAD:docs/community-search/quick-start/output/0100_install_operator.out - name: mongodb-search-community - repo: quay.io/mongodb - version: 1.47.0 -subresourceEnabled: true -======== - name: mongot/community - repo: 268558157000.dkr.ecr.eu-west-1.amazonaws.com - version: fbd60fb055dd500058edcb45677ea85d19421f47 ->>>>>>>> 6309cff6f (Refactor of existing snippets on master):scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + name: mongodb-search + repo: quay.io/mongodb/staging + version: latest versionUpgradeHook: name: mongodb-kubernetes-operator-version-upgrade-post-start-hook version: 1.0.9 @@ -199,6 +142,8 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-appdb namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret --- # Source: mongodb-kubernetes/templates/database-roles.yaml apiVersion: v1 @@ -206,6 +151,8 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-database-pods namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret --- # Source: mongodb-kubernetes/templates/database-roles.yaml apiVersion: v1 @@ -213,6 +160,8 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-ops-manager namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret --- # Source: mongodb-kubernetes/templates/operator-sa.yaml apiVersion: v1 @@ -220,8 +169,10 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-operator namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -234,34 +185,7 @@ rules: resources: - clustermongodbroles --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: mongodb-kubernetes-operator-mongodb-webhook -rules: - - apiGroups: - - "admissionregistration.k8s.io" - resources: - - validatingwebhookconfigurations - verbs: - - get - - create - - update - - delete - - apiGroups: - - "" - resources: - - services - verbs: - - get - - list - - watch - - create - - update - - delete ---- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-telemetry.yaml # Additional ClusterRole for clusterVersionDetection kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 @@ -289,7 +213,34 @@ rules: verbs: - list --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-webhook.yaml +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-webhook +rules: + - apiGroups: + - "admissionregistration.k8s.io" + resources: + - validatingwebhookconfigurations + verbs: + - get + - create + - update + - delete + - apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch + - create + - update + - delete +--- +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -303,30 +254,30 @@ subjects: name: mongodb-kubernetes-operator namespace: mongodb --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-telemetry.yaml +# ClusterRoleBinding for clusterVersionDetection kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mongodb-kubernetes-operator-mongodb-webhook-binding + name: mongodb-kubernetes-operator-mongodb-cluster-telemetry-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: mongodb-kubernetes-operator-mongodb-webhook + name: mongodb-kubernetes-operator-cluster-telemetry subjects: - kind: ServiceAccount name: mongodb-kubernetes-operator namespace: mongodb --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml -# ClusterRoleBinding for clusterVersionDetection +# Source: mongodb-kubernetes/templates/operator-roles-webhook.yaml kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: mongodb-kubernetes-operator-mongodb-cluster-telemetry-binding + name: mongodb-kubernetes-operator-mongodb-webhook-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: mongodb-kubernetes-operator-cluster-telemetry + name: mongodb-kubernetes-operator-mongodb-webhook subjects: - kind: ServiceAccount name: mongodb-kubernetes-operator @@ -354,7 +305,7 @@ rules: - delete - get --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-base.yaml kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -434,7 +385,14 @@ rules: - opsmanagers/status - mongodbmulticluster/status - mongodbsearch/status - +--- +# Source: mongodb-kubernetes/templates/operator-roles-pvc-resize.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-pvc-resize + namespace: mongodb +rules: - apiGroups: - '' resources: @@ -462,7 +420,7 @@ subjects: name: mongodb-kubernetes-appdb namespace: mongodb --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-base.yaml kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -477,6 +435,21 @@ subjects: name: mongodb-kubernetes-operator namespace: mongodb --- +# Source: mongodb-kubernetes/templates/operator-roles-pvc-resize.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-pvc-resize-binding + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-operator-pvc-resize +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- # Source: mongodb-kubernetes/templates/operator.yaml apiVersion: apps/v1 kind: Deployment @@ -501,9 +474,11 @@ spec: securityContext: runAsNonRoot: true runAsUser: 2000 + imagePullSecrets: + - name: prerelease-image-pullsecret containers: - name: mongodb-kubernetes-operator - image: "quay.io/mongodb/mongodb-kubernetes:1.2.0" + image: "quay.io/mongodb/staging/mongodb-kubernetes:1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2" imagePullPolicy: Always args: - -watch-resource=mongodb @@ -535,9 +510,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: MDB_OPERATOR_TELEMETRY_COLLECTION_FREQUENCY - value: "1m" - - name: MDB_OPERATOR_TELEMETRY_SEND_ENABLED - value: "false" + value: "1h" - name: MDB_OPERATOR_TELEMETRY_SEND_FREQUENCY value: "168h" - name: CLUSTER_CLIENT_TIMEOUT @@ -546,29 +519,29 @@ spec: value: Always # Database - name: MONGODB_ENTERPRISE_DATABASE_IMAGE - value: quay.io/mongodb/mongodb-kubernetes-database + value: quay.io/mongodb/staging/mongodb-kubernetes-database - name: INIT_DATABASE_IMAGE_REPOSITORY - value: quay.io/mongodb/mongodb-kubernetes-init-database + value: quay.io/mongodb/staging/mongodb-kubernetes-init-database - name: INIT_DATABASE_VERSION - value: 1.2.0 + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 - name: DATABASE_VERSION - value: 1.2.0 + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 # Ops Manager - name: OPS_MANAGER_IMAGE_REPOSITORY value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi - name: INIT_OPS_MANAGER_IMAGE_REPOSITORY - value: quay.io/mongodb/mongodb-kubernetes-init-ops-manager + value: quay.io/mongodb/staging/mongodb-kubernetes-init-ops-manager - name: INIT_OPS_MANAGER_VERSION - value: 1.2.0 + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 # AppDB - name: INIT_APPDB_IMAGE_REPOSITORY - value: quay.io/mongodb/mongodb-kubernetes-init-appdb + value: quay.io/mongodb/staging/mongodb-kubernetes-init-appdb - name: INIT_APPDB_VERSION - value: 1.2.0 + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 - name: OPS_MANAGER_IMAGE_PULL_POLICY value: Always - name: AGENT_IMAGE - value: "quay.io/mongodb/mongodb-agent:108.0.2.8729-1" + value: "quay.io/mongodb/mongodb-agent:108.0.12.8846-1" - name: MDB_AGENT_IMAGE_REPOSITORY value: "quay.io/mongodb/mongodb-agent" - name: MONGODB_IMAGE @@ -576,11 +549,13 @@ spec: - name: MONGODB_REPO_URL value: quay.io/mongodb - name: MDB_IMAGE_TYPE - value: ubi9 + value: ubi8 - name: PERFORM_FAILOVER value: 'true' + - name: IMAGE_PULL_SECRETS + value: prerelease-image-pullsecret - name: MDB_MAX_CONCURRENT_RECONCILES - value: "10" + value: "1" - name: POD_NAME valueFrom: fieldRef: @@ -602,15 +577,9 @@ spec: value: "ubi8" # Community Env Vars End - name: MDB_SEARCH_COMMUNITY_REPO_URL -<<<<<<<< HEAD:docs/community-search/quick-start/output/0100_install_operator.out - value: "quay.io/mongodb" - - name: MDB_SEARCH_COMMUNITY_NAME - value: "mongodb-search-community" -======== - value: "268558157000.dkr.ecr.eu-west-1.amazonaws.com" + value: "quay.io/mongodb/staging" - name: MDB_SEARCH_COMMUNITY_NAME - value: "mongot/community" ->>>>>>>> 6309cff6f (Refactor of existing snippets on master):scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + value: "mongodb-search" - name: MDB_SEARCH_COMMUNITY_VERSION - value: "1.47.0" + value: "latest" diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0110_wait_for_operator_deployment.out b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0110_wait_for_operator_deployment.out new file mode 100644 index 000000000..7c8a8b287 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0110_wait_for_operator_deployment.out @@ -0,0 +1,9 @@ +Waiting for deployment "mongodb-kubernetes-operator" rollout to finish: 0 of 1 updated replicas are available... +deployment "mongodb-kubernetes-operator" successfully rolled out +Operator deployment in mongodb namespace +NAME READY UP-TO-DATE AVAILABLE AGE +mongodb-kubernetes-operator 1/1 1 1 2s + +Operator pod in mongodb namespace +NAME READY STATUS RESTARTS AGE +mongodb-kubernetes-operator-5b44cd54d4-rjxrj 1/1 Running 0 3s diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0315_wait_for_community_resource.out b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0315_wait_for_community_resource.out index 2bc88b5b9..3110199cb 100644 --- a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0315_wait_for_community_resource.out +++ b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0315_wait_for_community_resource.out @@ -7,10 +7,10 @@ mdbc-rs Running 8.0.10 Pods running in cluster kind-kind NAME READY STATUS RESTARTS AGE -mdb-debug-mdbc-rs-0-0 1/1 Running 0 96s -mdb-debug-mdbc-rs-1-0 1/1 Running 0 95s -mdb-debug-mdbc-rs-2-0 1/1 Running 0 95s -mdbc-rs-0 2/2 Running 0 2m41s -mdbc-rs-1 2/2 Running 0 87s -mdbc-rs-2 2/2 Running 0 38s -mongodb-kubernetes-operator-696b5dd864-kpgkl 1/1 Running 0 2m49s +mdb-debug-mdbc-rs-0-0 1/1 Running 0 118s +mdb-debug-mdbc-rs-1-0 1/1 Running 0 118s +mdb-debug-mdbc-rs-2-0 1/1 Running 0 117s +mdbc-rs-0 2/2 Running 0 2m11s +mdbc-rs-1 2/2 Running 0 83s +mdbc-rs-2 2/2 Running 0 34s +mongodb-kubernetes-operator-5b44cd54d4-rjxrj 1/1 Running 0 2m16s diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0335_show_running_pods.out b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0335_show_running_pods.out index 6c2bcf86a..144cefd50 100644 --- a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0335_show_running_pods.out +++ b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0335_show_running_pods.out @@ -9,12 +9,12 @@ mdbc-rs Running 5m33s Pods running in cluster kind-kind NAME READY STATUS RESTARTS AGE -mdb-debug-mdbc-rs-0-0 1/1 Running 0 7m12s -mdb-debug-mdbc-rs-1-0 1/1 Running 0 7m11s -mdb-debug-mdbc-rs-2-0 1/1 Running 0 7m11s -mdb-debug-mdbc-rs-search-0-0 1/1 Running 0 5m33s -mdbc-rs-0 2/2 Running 1 (31s ago) 8m17s -mdbc-rs-1 2/2 Running 1 (3m8s ago) 7m3s -mdbc-rs-2 2/2 Running 1 (109s ago) 6m14s -mdbc-rs-search-0 1/1 Running 4 (4m17s ago) 5m34s -mongodb-kubernetes-operator-696b5dd864-kpgkl 1/1 Running 0 8m25s +mdb-debug-mdbc-rs-0-0 1/1 Running 0 7m32s +mdb-debug-mdbc-rs-1-0 1/1 Running 0 7m32s +mdb-debug-mdbc-rs-2-0 1/1 Running 0 7m31s +mdb-debug-mdbc-rs-search-0-0 1/1 Running 0 5m32s +mdbc-rs-0 2/2 Running 1 (33s ago) 7m45s +mdbc-rs-1 2/2 Running 1 (3m11s ago) 6m57s +mdbc-rs-2 2/2 Running 1 (113s ago) 6m8s +mdbc-rs-search-0 1/1 Running 4 (4m20s ago) 5m33s +mongodb-kubernetes-operator-5b44cd54d4-rjxrj 1/1 Running 0 7m50s diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0444_list_search_indexes.out b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0444_list_search_indexes.out index 871ba5e65..66bd52f34 100644 --- a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0444_list_search_indexes.out +++ b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0444_list_search_indexes.out @@ -4,15 +4,15 @@ ns: 'sample_mflix.movies', firstBatch: [ { - id: '68a9975db53fad6a875bb74f', + id: '68b5d833862bdd46756f23fe', name: 'default', type: 'search', latestDefinition: { - indexID: ObjectId('68a9975db53fad6a875bb74f'), + indexID: ObjectId('68b5d833862bdd46756f23fe'), name: 'default', database: 'sample_mflix', lastObservedCollectionName: 'movies', - collectionUUID: UUID('b28e600a-fd5f-459f-9a80-1cd85a113261'), + collectionUUID: UUID('eb5bdd9e-fe14-4a0e-a012-5af2d7324d7a'), numPartitions: 1, mappings: { dynamic: true, fields: {} }, indexFeatureVersion: 3 @@ -22,11 +22,11 @@ }, ok: 1, '$clusterTime': { - clusterTime: Timestamp({ t: 1755944851, i: 1 }), + clusterTime: Timestamp({ t: 1756747889, i: 1 }), signature: { - hash: Binary.createFromBase64('P3ygPKAHEg7beuDCsygB5MSm0xQ=', 0), - keyId: Long('7541723951982968838') + hash: Binary.createFromBase64('BJNOThO1gxmbkTscNSABaUstAy0=', 0), + keyId: Long('7545172961045512197') } }, - operationTime: Timestamp({ t: 1755944851, i: 1 }) + operationTime: Timestamp({ t: 1756747889, i: 1 }) } diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0445_list_vector_search_indexes.out b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0445_list_vector_search_indexes.out index 2b7013164..afac79fb5 100644 --- a/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0445_list_vector_search_indexes.out +++ b/scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/03_0445_list_vector_search_indexes.out @@ -4,16 +4,16 @@ ns: 'sample_mflix.embedded_movies', firstBatch: [ { - id: '68a9975eb53fad6a875bb750', + id: '68b5d834862bdd46756f23ff', name: 'vector_index', type: 'vectorSearch', latestDefinition: { type: 'vectorSearch', - indexID: ObjectId('68a9975eb53fad6a875bb750'), + indexID: ObjectId('68b5d834862bdd46756f23ff'), name: 'vector_index', database: 'sample_mflix', lastObservedCollectionName: 'embedded_movies', - collectionUUID: UUID('19e50df1-f30c-47ae-9a98-1b0986f19d1e'), + collectionUUID: UUID('98d05ae8-9fa5-4813-9833-54355c75a016'), numPartitions: 1, fields: [ { @@ -30,11 +30,11 @@ }, ok: 1, '$clusterTime': { - clusterTime: Timestamp({ t: 1755944861, i: 1 }), + clusterTime: Timestamp({ t: 1756747889, i: 1 }), signature: { - hash: Binary.createFromBase64('MpVLnzPwR4lpliG75kYSEMdvHXk=', 0), - keyId: Long('7541723951982968838') + hash: Binary.createFromBase64('BJNOThO1gxmbkTscNSABaUstAy0=', 0), + keyId: Long('7545172961045512197') } }, - operationTime: Timestamp({ t: 1755944861, i: 1 }) + operationTime: Timestamp({ t: 1756747889, i: 1 }) } diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0090_helm_add_mogodb_repo.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0090_helm_add_mogodb_repo.out new file mode 100644 index 000000000..b1576c236 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0090_helm_add_mogodb_repo.out @@ -0,0 +1,6 @@ +"mongodb" already exists with the same configuration, skipping +Hang tight while we grab the latest from your chart repositories... +...Successfully got an update from the "mongodb" chart repository +Update Complete. ⎈Happy Helming!⎈ +NAME CHART VERSION APP VERSION DESCRIPTION +mongodb/mongodb-kubernetes 1.2.0 MongoDB Controllers for Kubernetes translate th... diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0100_install_operator.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0100_install_operator.out new file mode 100644 index 000000000..0f016af81 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0100_install_operator.out @@ -0,0 +1,585 @@ +Release "mongodb-kubernetes" does not exist. Installing it now. +NAME: mongodb-kubernetes +LAST DEPLOYED: Mon Sep 1 18:24:58 2025 +NAMESPACE: mongodb +STATUS: deployed +REVISION: 1 +TEST SUITE: None +USER-SUPPLIED VALUES: +registry: + imagePullSecrets: prerelease-image-pullsecret + +COMPUTED VALUES: +agent: + name: mongodb-agent + version: 108.0.12.8846-1 +community: + agent: + name: mongodb-agent + version: 108.0.2.8729-1 + mongodb: + imageType: ubi8 + name: mongodb-community-server + repo: quay.io/mongodb + name: mongodb-database + registry: + agent: quay.io/mongodb + resource: + members: 3 + name: mongodb-replica-set + tls: + caCertificateSecretRef: tls-ca-key-pair + certManager: + certDuration: 8760h + renewCertBefore: 720h + certificateKeySecretRef: tls-certificate + enabled: false + sampleX509User: false + useCertManager: true + useX509: false + version: 4.4.0 +database: + name: mongodb-kubernetes-database + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +initAppDb: + name: mongodb-kubernetes-init-appdb + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +initDatabase: + name: mongodb-kubernetes-init-database + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +initOpsManager: + name: mongodb-kubernetes-init-ops-manager + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +managedSecurityContext: false +mongodb: + appdbAssumeOldFormat: false + imageType: ubi8 + name: mongodb-enterprise-server + repo: quay.io/mongodb +multiCluster: + clusterClientTimeout: 10 + clusters: [] + kubeConfigSecretName: mongodb-enterprise-operator-multi-cluster-kubeconfig + performFailOver: true +operator: + additionalArguments: [] + affinity: {} + baseName: mongodb-kubernetes + createOperatorServiceAccount: true + createResourcesServiceAccountsAndRoles: true + deployment_name: mongodb-kubernetes-operator + enableClusterMongoDBRoles: true + enablePVCResize: true + env: prod + maxConcurrentReconciles: 1 + mdbDefaultArchitecture: non-static + name: mongodb-kubernetes-operator + nodeSelector: {} + operator_image_name: mongodb-kubernetes + replicas: 1 + resources: + limits: + cpu: 1100m + memory: 1Gi + requests: + cpu: 500m + memory: 200Mi + telemetry: + collection: + clusters: {} + deployments: {} + frequency: 1h + operators: {} + send: + frequency: 168h + tolerations: [] + vaultSecretBackend: + enabled: false + tlsSecretRef: "" + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + watchedResources: + - mongodb + - opsmanagers + - mongodbusers + - mongodbcommunity + - mongodbsearch + webhook: + installClusterRole: true + registerConfiguration: true +opsManager: + name: mongodb-enterprise-ops-manager-ubi +readinessProbe: + name: mongodb-kubernetes-readinessprobe + version: 1.0.22 +registry: + agent: quay.io/mongodb + appDb: quay.io/mongodb/staging + database: quay.io/mongodb/staging + imagePullSecrets: prerelease-image-pullsecret + initAppDb: quay.io/mongodb/staging + initDatabase: quay.io/mongodb/staging + initOpsManager: quay.io/mongodb/staging + operator: quay.io/mongodb/staging + opsManager: quay.io/mongodb + pullPolicy: Always + readinessProbe: quay.io/mongodb + versionUpgradeHook: quay.io/mongodb +search: + community: + name: mongodb-search + repo: quay.io/mongodb/staging + version: latest +versionUpgradeHook: + name: mongodb-kubernetes-operator-version-upgrade-post-start-hook + version: 1.0.9 + +HOOKS: +MANIFEST: +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-appdb + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-database-pods + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-ops-manager + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/operator-sa.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-cluster-mongodb-role +rules: + - apiGroups: + - mongodb.com + verbs: + - '*' + resources: + - clustermongodbroles +--- +# Source: mongodb-kubernetes/templates/operator-roles-telemetry.yaml +# Additional ClusterRole for clusterVersionDetection +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-cluster-telemetry +rules: + # Non-resource URL permissions + - nonResourceURLs: + - "/version" + verbs: + - get + # Cluster-scoped resource permissions + - apiGroups: + - '' + resources: + - namespaces + resourceNames: + - kube-system + verbs: + - get + - apiGroups: + - '' + resources: + - nodes + verbs: + - list +--- +# Source: mongodb-kubernetes/templates/operator-roles-webhook.yaml +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-webhook +rules: + - apiGroups: + - "admissionregistration.k8s.io" + resources: + - validatingwebhookconfigurations + verbs: + - get + - create + - update + - delete + - apiGroups: + - "" + resources: + - services + verbs: + - get + - list + - watch + - create + - update + - delete +--- +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-cluster-mongodb-role-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-kubernetes-operator-mongodb-cluster-mongodb-role +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-telemetry.yaml +# ClusterRoleBinding for clusterVersionDetection +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-cluster-telemetry-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-kubernetes-operator-cluster-telemetry +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-webhook.yaml +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-webhook-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-kubernetes-operator-mongodb-webhook +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-appdb + namespace: mongodb +rules: + - apiGroups: + - '' + resources: + - secrets + verbs: + - get + - apiGroups: + - '' + resources: + - pods + verbs: + - patch + - delete + - get +--- +# Source: mongodb-kubernetes/templates/operator-roles-base.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +rules: + - apiGroups: + - '' + resources: + - services + verbs: + - get + - list + - watch + - create + - update + - delete + - apiGroups: + - '' + resources: + - secrets + - configmaps + verbs: + - get + - list + - create + - update + - delete + - watch + - apiGroups: + - apps + resources: + - statefulsets + verbs: + - create + - get + - list + - watch + - delete + - update + - apiGroups: + - '' + resources: + - pods + verbs: + - get + - list + - watch + - delete + - deletecollection + - apiGroups: + - mongodbcommunity.mongodb.com + resources: + - mongodbcommunity + - mongodbcommunity/status + - mongodbcommunity/spec + - mongodbcommunity/finalizers + verbs: + - '*' + - apiGroups: + - mongodb.com + verbs: + - '*' + resources: + - mongodb + - mongodb/finalizers + - mongodbusers + - mongodbusers/finalizers + - opsmanagers + - opsmanagers/finalizers + - mongodbmulticluster + - mongodbmulticluster/finalizers + - mongodbsearch + - mongodbsearch/finalizers + - mongodb/status + - mongodbusers/status + - opsmanagers/status + - mongodbmulticluster/status + - mongodbsearch/status +--- +# Source: mongodb-kubernetes/templates/operator-roles-pvc-resize.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-pvc-resize + namespace: mongodb +rules: + - apiGroups: + - '' + resources: + - persistentvolumeclaims + verbs: + - get + - delete + - list + - watch + - patch + - update +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-appdb + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-appdb +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-appdb + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-base.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-operator +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-pvc-resize.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-pvc-resize-binding + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-operator-pvc-resize +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: mongodb-kubernetes-operator + app.kubernetes.io/instance: mongodb-kubernetes-operator + template: + metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: mongodb-kubernetes-operator + app.kubernetes.io/instance: mongodb-kubernetes-operator + spec: + serviceAccountName: mongodb-kubernetes-operator + securityContext: + runAsNonRoot: true + runAsUser: 2000 + imagePullSecrets: + - name: prerelease-image-pullsecret + containers: + - name: mongodb-kubernetes-operator + image: "quay.io/mongodb/staging/mongodb-kubernetes:1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2" + imagePullPolicy: Always + args: + - -watch-resource=mongodb + - -watch-resource=opsmanagers + - -watch-resource=mongodbusers + - -watch-resource=mongodbcommunity + - -watch-resource=mongodbsearch + - -watch-resource=clustermongodbroles + command: + - /usr/local/bin/mongodb-kubernetes-operator + resources: + limits: + cpu: 1100m + memory: 1Gi + requests: + cpu: 500m + memory: 200Mi + env: + - name: OPERATOR_ENV + value: prod + - name: MDB_DEFAULT_ARCHITECTURE + value: non-static + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: MDB_OPERATOR_TELEMETRY_COLLECTION_FREQUENCY + value: "1h" + - name: MDB_OPERATOR_TELEMETRY_SEND_FREQUENCY + value: "168h" + - name: CLUSTER_CLIENT_TIMEOUT + value: "10" + - name: IMAGE_PULL_POLICY + value: Always + # Database + - name: MONGODB_ENTERPRISE_DATABASE_IMAGE + value: quay.io/mongodb/staging/mongodb-kubernetes-database + - name: INIT_DATABASE_IMAGE_REPOSITORY + value: quay.io/mongodb/staging/mongodb-kubernetes-init-database + - name: INIT_DATABASE_VERSION + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + - name: DATABASE_VERSION + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + # Ops Manager + - name: OPS_MANAGER_IMAGE_REPOSITORY + value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi + - name: INIT_OPS_MANAGER_IMAGE_REPOSITORY + value: quay.io/mongodb/staging/mongodb-kubernetes-init-ops-manager + - name: INIT_OPS_MANAGER_VERSION + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + # AppDB + - name: INIT_APPDB_IMAGE_REPOSITORY + value: quay.io/mongodb/staging/mongodb-kubernetes-init-appdb + - name: INIT_APPDB_VERSION + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + - name: OPS_MANAGER_IMAGE_PULL_POLICY + value: Always + - name: AGENT_IMAGE + value: "quay.io/mongodb/mongodb-agent:108.0.12.8846-1" + - name: MDB_AGENT_IMAGE_REPOSITORY + value: "quay.io/mongodb/mongodb-agent" + - name: MONGODB_IMAGE + value: mongodb-enterprise-server + - name: MONGODB_REPO_URL + value: quay.io/mongodb + - name: MDB_IMAGE_TYPE + value: ubi8 + - name: PERFORM_FAILOVER + value: 'true' + - name: IMAGE_PULL_SECRETS + value: prerelease-image-pullsecret + - name: MDB_MAX_CONCURRENT_RECONCILES + value: "1" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: OPERATOR_NAME + value: mongodb-kubernetes-operator + # Community Env Vars Start + - name: MDB_COMMUNITY_AGENT_IMAGE + value: "quay.io/mongodb/mongodb-agent:108.0.2.8729-1" + - name: VERSION_UPGRADE_HOOK_IMAGE + value: "quay.io/mongodb/mongodb-kubernetes-operator-version-upgrade-post-start-hook:1.0.9" + - name: READINESS_PROBE_IMAGE + value: "quay.io/mongodb/mongodb-kubernetes-readinessprobe:1.0.22" + - name: MDB_COMMUNITY_IMAGE + value: "mongodb-community-server" + - name: MDB_COMMUNITY_REPO_URL + value: "quay.io/mongodb" + - name: MDB_COMMUNITY_IMAGE_TYPE + value: "ubi8" + # Community Env Vars End + - name: MDB_SEARCH_COMMUNITY_REPO_URL + value: "quay.io/mongodb/staging" + - name: MDB_SEARCH_COMMUNITY_NAME + value: "mongodb-search" + - name: MDB_SEARCH_COMMUNITY_VERSION + value: "latest" + diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0310_wait_for_database_resource.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0310_wait_for_database_resource.out new file mode 100644 index 000000000..9a5c191d1 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0310_wait_for_database_resource.out @@ -0,0 +1,16 @@ +Waiting for MongoDB resource to reach Running phase... +mongodb.mongodb.com/mdb-rs condition met + +MongoDB resource +NAME PHASE VERSION TYPE AGE +mdb-rs Running 8.0.10 ReplicaSet 2m46s + +Pods running in cluster kind-kind +NAME READY STATUS RESTARTS AGE +mdb-debug-mdb-rs-0-0 1/1 Running 0 2m26s +mdb-debug-mdb-rs-1-0 1/1 Running 0 2m26s +mdb-debug-mdb-rs-2-0 1/1 Running 0 2m25s +mdb-rs-0 1/1 Running 0 2m29s +mdb-rs-1 1/1 Running 0 89s +mdb-rs-2 1/1 Running 0 46s +mongodb-kubernetes-operator-5b44cd54d4-kvrpv 1/1 Running 0 2m47s diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0335_show_running_pods.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0335_show_running_pods.out new file mode 100644 index 000000000..97734a89d --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/02_0335_show_running_pods.out @@ -0,0 +1,20 @@ + +MongoDB resource +NAME PHASE VERSION TYPE AGE +mdb-rs Running 8.0.10 ReplicaSet 4m26s + +MongoDBSearch resource +NAME PHASE AGE +mdb-rs Running 97s + +Pods running in cluster kind-kind +NAME READY STATUS RESTARTS AGE +mdb-debug-mdb-rs-0-0 1/1 Running 0 4m7s +mdb-debug-mdb-rs-1-0 1/1 Running 0 4m7s +mdb-debug-mdb-rs-2-0 1/1 Running 0 4m6s +mdb-debug-mdb-rs-search-0-0 1/1 Running 0 97s +mdb-rs-0 1/1 Running 0 4m10s +mdb-rs-1 1/1 Running 0 3m10s +mdb-rs-2 1/1 Running 0 2m27s +mdb-rs-search-0 1/1 Running 0 29s +mongodb-kubernetes-operator-5b44cd54d4-kvrpv 1/1 Running 0 4m28s diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0420_import_movies_mflix_database.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0420_import_movies_mflix_database.out new file mode 100644 index 000000000..a7432faf0 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0420_import_movies_mflix_database.out @@ -0,0 +1,2 @@ +Downloading sample database archive... +Restoring sample database diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0440_wait_for_search_index_ready.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0440_wait_for_search_index_ready.out new file mode 100644 index 000000000..b264580af --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0440_wait_for_search_index_ready.out @@ -0,0 +1 @@ +Sleeping to wait for search indexes to be created diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0444_list_search_indexes.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0444_list_search_indexes.out new file mode 100644 index 000000000..09342c66e --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0444_list_search_indexes.out @@ -0,0 +1,32 @@ +{ + cursor: { + id: 0, + ns: 'sample_mflix.movies', + firstBatch: [ + { + id: '68b5c9f984d938552792ba0c', + name: 'default', + type: 'search', + latestDefinition: { + indexID: ObjectId('68b5c9f984d938552792ba0c'), + name: 'default', + database: 'sample_mflix', + lastObservedCollectionName: 'movies', + collectionUUID: UUID('b4127db1-78ed-4f2a-b8e8-54a826075622'), + numPartitions: 1, + mappings: { dynamic: true, fields: {} }, + indexFeatureVersion: 3 + } + } + ] + }, + ok: 1, + '$clusterTime': { + clusterTime: Timestamp({ t: 1756744247, i: 1 }), + signature: { + hash: Binary.createFromBase64('7Ylj1qg2orgtBnElSVeObPTpTjw=', 0), + keyId: Long('7545158272257359877') + } + }, + operationTime: Timestamp({ t: 1756744247, i: 1 }) +} diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0445_list_vector_search_indexes.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0445_list_vector_search_indexes.out new file mode 100644 index 000000000..a8d0a7470 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0445_list_vector_search_indexes.out @@ -0,0 +1,40 @@ +{ + cursor: { + id: 0, + ns: 'sample_mflix.embedded_movies', + firstBatch: [ + { + id: '68b5c9fa84d938552792ba0d', + name: 'vector_index', + type: 'vectorSearch', + latestDefinition: { + type: 'vectorSearch', + indexID: ObjectId('68b5c9fa84d938552792ba0d'), + name: 'vector_index', + database: 'sample_mflix', + lastObservedCollectionName: 'embedded_movies', + collectionUUID: UUID('c9a6ef19-2993-4edc-904e-31964b889467'), + numPartitions: 1, + fields: [ + { + type: 'vector', + path: 'plot_embedding_voyage_3_large', + numDimensions: 2048, + similarity: 'dotProduct', + quantization: 'scalar' + } + ] + } + } + ] + }, + ok: 1, + '$clusterTime': { + clusterTime: Timestamp({ t: 1756744247, i: 1 }), + signature: { + hash: Binary.createFromBase64('7Ylj1qg2orgtBnElSVeObPTpTjw=', 0), + keyId: Long('7545158272257359877') + } + }, + operationTime: Timestamp({ t: 1756744247, i: 1 }) +} diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0450_execute_search_query.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0450_execute_search_query.out new file mode 100644 index 000000000..f425a96d8 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0450_execute_search_query.out @@ -0,0 +1,22 @@ +mdb-rs [primary] test> switched to db sample_mflix +mdb-rs [primary] sample_mflix> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... [ + { + plot: 'A sports agent stages an unconventional recruitment strategy to get talented Indian cricket players to play Major League Baseball.', + genres: [ 'Biography', 'Drama', 'Sport' ], + title: 'Million Dollar Arm', + released: ISODate('2014-05-16T00:00:00.000Z') + }, + { + plot: 'A Taiwanese high school baseball team travels to Japan in 1931 to compete in a national tournament.', + genres: [ 'Biography', 'Drama', 'History' ], + title: 'Kano', + released: ISODate('2014-02-27T00:00:00.000Z') + }, + { + plot: "12-year-old Josh is a mixed race boy and a promising baseball player. He is abused by his mother's boyfriend Byrd, and neglected by his mother Debbie. He forges his own path in life when ...", + genres: [ 'Drama' ], + title: 'Calloused Hands', + released: ISODate('2013-03-03T00:00:00.000Z') + } +] +mdb-rs [primary] sample_mflix> \ No newline at end of file diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0455_execute_vector_search_query.out b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0455_execute_vector_search_query.out new file mode 100644 index 000000000..1623a6fdc --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_enterprise_snippets/03_0455_execute_vector_search_query.out @@ -0,0 +1,54 @@ +mdb-rs [primary] test> switched to db sample_mflix +mdb-rs [primary] sample_mflix> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... [ + { + plot: 'At the age of 21, Tim discovers he can travel in time and change what happens and has happened in his own life. His decision to make his world a better place by getting a girlfriend turns out not to be as easy as you might think.', + title: 'About Time', + score: 0.7704131603240967 + }, + { + plot: 'A psychiatrist makes multiple trips through time to save a woman that was murdered by her brutal husband.', + title: 'Retroactive', + score: 0.7597770690917969 + }, + { + plot: 'An officer for a security agency that regulates time travel, must fend for his life against a shady politician who has a tie to his past.', + title: 'Timecop', + score: 0.7574796676635742 + }, + { + plot: 'A time-travel experiment in which a robot probe is sent from the year 2073 to the year 1973 goes terribly wrong thrusting one of the project scientists, a man named Nicholas Sinclair into a...', + title: 'A.P.E.X.', + score: 0.7573235034942627 + }, + { + plot: 'After visiting 2015, Marty McFly must repeat his visit to 1955 to prevent disastrous changes to 1985... without interfering with his first trip.', + title: 'Back to the Future Part II', + score: 0.751945972442627 + }, + { + plot: 'A reporter, learning of time travelers visiting 20th century disasters, tries to change the history they know by averting upcoming disasters.', + title: 'Thrill Seekers', + score: 0.7503504753112793 + }, + { + plot: 'Hoping to alter the events of the past, a 19th century inventor instead travels 800,000 years into the future, where he finds humankind divided into two warring races.', + title: 'The Time Machine', + score: 0.750007152557373 + }, + { + plot: 'Lyle, a motorcycle champion is traveling the Mexican desert, when he find himself in the action radius of a time machine. So he find himself one century back in the past between rapists, ...', + title: 'Timerider: The Adventure of Lyle Swann', + score: 0.7499568462371826 + }, + { + plot: 'A romantic drama about a Chicago librarian with a gene that causes him to involuntarily time travel, and the complications it creates for his marriage.', + title: "The Time Traveler's Wife", + score: 0.7492842674255371 + }, + { + plot: 'A modern aircraft carrier is thrown back in time to 1941 near Hawaii, just hours before the Japanese attack on Pearl Harbor.', + title: 'The Final Countdown', + score: 0.7472751140594482 + } +] +mdb-rs [primary] sample_mflix> \ No newline at end of file diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0420_import_movies_mflix_database.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0420_import_movies_mflix_database.out new file mode 100644 index 000000000..a7432faf0 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0420_import_movies_mflix_database.out @@ -0,0 +1,2 @@ +Downloading sample database archive... +Restoring sample database diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0440_wait_for_search_index_ready.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0440_wait_for_search_index_ready.out new file mode 100644 index 000000000..b264580af --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0440_wait_for_search_index_ready.out @@ -0,0 +1 @@ +Sleeping to wait for search indexes to be created diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0444_list_search_indexes.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0444_list_search_indexes.out new file mode 100644 index 000000000..eca57d146 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0444_list_search_indexes.out @@ -0,0 +1,32 @@ +{ + cursor: { + id: 0, + ns: 'sample_mflix.movies', + firstBatch: [ + { + id: '68b9a74d02abb82501c6798f', + name: 'default', + type: 'search', + latestDefinition: { + indexID: ObjectId('68b9a74d02abb82501c6798f'), + name: 'default', + database: 'sample_mflix', + lastObservedCollectionName: 'movies', + collectionUUID: UUID('c508d917-fa90-4830-9cae-4bfdf283adf9'), + numPartitions: 1, + mappings: { dynamic: true, fields: {} }, + indexFeatureVersion: 3 + } + } + ] + }, + ok: 1, + '$clusterTime': { + clusterTime: Timestamp({ t: 1756997506, i: 1 }), + signature: { + hash: Binary.createFromBase64('JTx8mqTc/CRMoHEoWXHCSZmpdrY=', 0), + keyId: Long('7546246397926834181') + } + }, + operationTime: Timestamp({ t: 1756997506, i: 1 }) +} diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0445_list_vector_search_indexes.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0445_list_vector_search_indexes.out new file mode 100644 index 000000000..10672efeb --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0445_list_vector_search_indexes.out @@ -0,0 +1,40 @@ +{ + cursor: { + id: 0, + ns: 'sample_mflix.embedded_movies', + firstBatch: [ + { + id: '68b9a74f02abb82501c67990', + name: 'vector_index', + type: 'vectorSearch', + latestDefinition: { + type: 'vectorSearch', + indexID: ObjectId('68b9a74f02abb82501c67990'), + name: 'vector_index', + database: 'sample_mflix', + lastObservedCollectionName: 'embedded_movies', + collectionUUID: UUID('cace05a2-489b-46ff-b99f-d8621f5a99d5'), + numPartitions: 1, + fields: [ + { + type: 'vector', + path: 'plot_embedding_voyage_3_large', + numDimensions: 2048, + similarity: 'dotProduct', + quantization: 'scalar' + } + ] + } + } + ] + }, + ok: 1, + '$clusterTime': { + clusterTime: Timestamp({ t: 1756997516, i: 1 }), + signature: { + hash: Binary.createFromBase64('BXpSMHzI3V6cXoFjWjaeV0/OJK4=', 0), + keyId: Long('7546246397926834181') + } + }, + operationTime: Timestamp({ t: 1756997516, i: 1 }) +} diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0450_execute_search_query.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0450_execute_search_query.out new file mode 100644 index 000000000..6d4329fb2 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0450_execute_search_query.out @@ -0,0 +1,22 @@ +mdbc-rs [primary] test> switched to db sample_mflix +mdbc-rs [primary] sample_mflix> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... [ + { + plot: 'A sports agent stages an unconventional recruitment strategy to get talented Indian cricket players to play Major League Baseball.', + genres: [ 'Biography', 'Drama', 'Sport' ], + title: 'Million Dollar Arm', + released: ISODate('2014-05-16T00:00:00.000Z') + }, + { + plot: 'A Taiwanese high school baseball team travels to Japan in 1931 to compete in a national tournament.', + genres: [ 'Biography', 'Drama', 'History' ], + title: 'Kano', + released: ISODate('2014-02-27T00:00:00.000Z') + }, + { + plot: "12-year-old Josh is a mixed race boy and a promising baseball player. He is abused by his mother's boyfriend Byrd, and neglected by his mother Debbie. He forges his own path in life when ...", + genres: [ 'Drama' ], + title: 'Calloused Hands', + released: ISODate('2013-03-03T00:00:00.000Z') + } +] +mdbc-rs [primary] sample_mflix> \ No newline at end of file diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0455_execute_vector_search_query.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0455_execute_vector_search_query.out new file mode 100644 index 000000000..fb9f3de41 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/03_0455_execute_vector_search_query.out @@ -0,0 +1,54 @@ +mdbc-rs [primary] test> switched to db sample_mflix +mdbc-rs [primary] sample_mflix> ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... [ + { + plot: 'At the age of 21, Tim discovers he can travel in time and change what happens and has happened in his own life. His decision to make his world a better place by getting a girlfriend turns out not to be as easy as you might think.', + title: 'About Time', + score: 0.7704131603240967 + }, + { + plot: 'A psychiatrist makes multiple trips through time to save a woman that was murdered by her brutal husband.', + title: 'Retroactive', + score: 0.7597770690917969 + }, + { + plot: 'An officer for a security agency that regulates time travel, must fend for his life against a shady politician who has a tie to his past.', + title: 'Timecop', + score: 0.7574796676635742 + }, + { + plot: 'A time-travel experiment in which a robot probe is sent from the year 2073 to the year 1973 goes terribly wrong thrusting one of the project scientists, a man named Nicholas Sinclair into a...', + title: 'A.P.E.X.', + score: 0.7573235034942627 + }, + { + plot: 'After visiting 2015, Marty McFly must repeat his visit to 1955 to prevent disastrous changes to 1985... without interfering with his first trip.', + title: 'Back to the Future Part II', + score: 0.751945972442627 + }, + { + plot: 'A reporter, learning of time travelers visiting 20th century disasters, tries to change the history they know by averting upcoming disasters.', + title: 'Thrill Seekers', + score: 0.7503504753112793 + }, + { + plot: 'Hoping to alter the events of the past, a 19th century inventor instead travels 800,000 years into the future, where he finds humankind divided into two warring races.', + title: 'The Time Machine', + score: 0.750007152557373 + }, + { + plot: 'Lyle, a motorcycle champion is traveling the Mexican desert, when he find himself in the action radius of a time machine. So he find himself one century back in the past between rapists, ...', + title: 'Timerider: The Adventure of Lyle Swann', + score: 0.7499568462371826 + }, + { + plot: 'A romantic drama about a Chicago librarian with a gene that causes him to involuntarily time travel, and the complications it creates for his marriage.', + title: "The Time Traveler's Wife", + score: 0.7492842674255371 + }, + { + plot: 'A modern aircraft carrier is thrown back in time to 1941 near Hawaii, just hours before the Japanese attack on Pearl Harbor.', + title: 'The Final Countdown', + score: 0.7472751140594482 + } +] +mdbc-rs [primary] sample_mflix> \ No newline at end of file diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out new file mode 100644 index 000000000..a6002b4b8 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out @@ -0,0 +1,666 @@ +Release "mongodb-kubernetes" does not exist. Installing it now. +NAME: mongodb-kubernetes +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out +LAST DEPLOYED: Thu Sep 4 16:47:34 2025 +======== +LAST DEPLOYED: Mon Sep 1 19:22:18 2025 +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out +NAMESPACE: mongodb +STATUS: deployed +REVISION: 1 +TEST SUITE: None +USER-SUPPLIED VALUES: +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out +agent: + version: 108.0.12.8846-1 +community: + registry: + agent: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev +database: + name: mongodb-kubernetes-database + version: 68a83a6562a059000707301b +initAppDb: + version: 68a83a6562a059000707301b +initDatabase: + version: 68a83a6562a059000707301b +initOpsManager: + version: 68a83a6562a059000707301b +managedSecurityContext: false +mongodb: + imageType: ubi9 + name: mongodb-enterprise-server +operator: + enablePVCResize: true + maxConcurrentReconciles: 10 + mdbDefaultArchitecture: non-static + telemetry: + collection: + frequency: 1m + send: + enabled: false + version: 68a83a6562a059000707301b +opsManager: + name: mongodb-enterprise-ops-manager-ubi +registry: + agent: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + appDb: quay.io/mongodb + database: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + imagePullSecrets: image-registries-secret + initAppDb: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + initDatabase: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + initOpsManager: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + operator: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + opsManager: quay.io/mongodb +search: + community: + name: mongot/community + repo: 268558157000.dkr.ecr.eu-west-1.amazonaws.com + version: 1.53.0-78-g227f2593f +======== +registry: + imagePullSecrets: prerelease-image-pullsecret +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + +COMPUTED VALUES: +agent: + name: mongodb-agent + version: 108.0.12.8846-1 +community: + agent: + name: mongodb-agent + version: 108.0.2.8729-1 + mongodb: + imageType: ubi8 + name: mongodb-community-server + repo: quay.io/mongodb + name: mongodb-database + registry: + agent: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev + resource: + members: 3 + name: mongodb-replica-set + tls: + caCertificateSecretRef: tls-ca-key-pair + certManager: + certDuration: 8760h + renewCertBefore: 720h + certificateKeySecretRef: tls-certificate + enabled: false + sampleX509User: false + useCertManager: true + useX509: false + version: 4.4.0 +database: + name: mongodb-kubernetes-database +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + version: 68a83a6562a059000707301b +initAppDb: + name: mongodb-kubernetes-init-appdb + version: 68a83a6562a059000707301b +initDatabase: + name: mongodb-kubernetes-init-database + version: 68a83a6562a059000707301b +initOpsManager: + name: mongodb-kubernetes-init-ops-manager + version: 68a83a6562a059000707301b +======== + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +initAppDb: + name: mongodb-kubernetes-init-appdb + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +initDatabase: + name: mongodb-kubernetes-init-database + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +initOpsManager: + name: mongodb-kubernetes-init-ops-manager + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out +managedSecurityContext: false +mongodb: + appdbAssumeOldFormat: false + imageType: ubi9 + name: mongodb-enterprise-server + repo: quay.io/mongodb +multiCluster: + clusterClientTimeout: 10 + clusters: [] + kubeConfigSecretName: mongodb-enterprise-operator-multi-cluster-kubeconfig + performFailOver: true +operator: + additionalArguments: [] + affinity: {} + baseName: mongodb-kubernetes + createOperatorServiceAccount: true + createResourcesServiceAccountsAndRoles: true + deployment_name: mongodb-kubernetes-operator + enableClusterMongoDBRoles: true + enablePVCResize: true + env: prod + maxConcurrentReconciles: 10 + mdbDefaultArchitecture: non-static + name: mongodb-kubernetes-operator + nodeSelector: {} + operator_image_name: mongodb-kubernetes + replicas: 1 + resources: + limits: + cpu: 1100m + memory: 1Gi + requests: + cpu: 500m + memory: 200Mi + telemetry: + collection: + clusters: {} + deployments: {} + frequency: 1m + operators: {} + send: + enabled: false + frequency: 168h + tolerations: [] + vaultSecretBackend: + enabled: false + tlsSecretRef: "" +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + version: 68a83a6562a059000707301b +======== + version: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + watchedResources: + - mongodb + - opsmanagers + - mongodbusers + - mongodbcommunity + - mongodbsearch + webhook: + installClusterRole: true + registerConfiguration: true +opsManager: + name: mongodb-enterprise-ops-manager-ubi +readinessProbe: + name: mongodb-kubernetes-readinessprobe + version: 1.0.22 +registry: + agent: quay.io/mongodb + appDb: quay.io/mongodb/staging + database: quay.io/mongodb/staging + imagePullSecrets: prerelease-image-pullsecret + initAppDb: quay.io/mongodb/staging + initDatabase: quay.io/mongodb/staging + initOpsManager: quay.io/mongodb/staging + operator: quay.io/mongodb/staging + opsManager: quay.io/mongodb + pullPolicy: Always + readinessProbe: quay.io/mongodb + versionUpgradeHook: quay.io/mongodb +search: + community: +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + name: mongot/community + repo: 268558157000.dkr.ecr.eu-west-1.amazonaws.com + version: 1.53.0-78-g227f2593f +======== + name: mongodb-search + repo: quay.io/mongodb/staging + version: latest +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out +versionUpgradeHook: + name: mongodb-kubernetes-operator-version-upgrade-post-start-hook + version: 1.0.9 + +HOOKS: +MANIFEST: +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-appdb + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-database-pods + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-ops-manager + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/operator-sa.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +imagePullSecrets: + - name: prerelease-image-pullsecret +--- +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-cluster-mongodb-role +rules: + - apiGroups: + - mongodb.com + verbs: + - '*' + resources: + - clustermongodbroles +--- +# Source: mongodb-kubernetes/templates/operator-roles-telemetry.yaml +# Additional ClusterRole for clusterVersionDetection +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-cluster-telemetry +rules: + # Non-resource URL permissions + - nonResourceURLs: + - "/version" + verbs: + - get + # Cluster-scoped resource permissions + - apiGroups: + - '' + resources: + - namespaces + resourceNames: + - kube-system + verbs: + - get + - apiGroups: + - '' + resources: + - nodes + verbs: + - list +--- +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-cluster-mongodb-role-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-kubernetes-operator-mongodb-cluster-mongodb-role +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-telemetry.yaml +# ClusterRoleBinding for clusterVersionDetection +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-cluster-telemetry-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-kubernetes-operator-cluster-telemetry +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-webhook.yaml +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-mongodb-webhook-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: mongodb-kubernetes-operator-mongodb-webhook +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-appdb + namespace: mongodb +rules: + - apiGroups: + - '' + resources: + - secrets + verbs: + - get + - apiGroups: + - '' + resources: + - pods + verbs: + - patch + - delete + - get +--- +# Source: mongodb-kubernetes/templates/operator-roles-base.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +rules: + - apiGroups: + - '' + resources: + - services + verbs: + - get + - list + - watch + - create + - update + - delete + - apiGroups: + - '' + resources: + - secrets + - configmaps + verbs: + - get + - list + - create + - update + - delete + - watch + - apiGroups: + - apps + resources: + - statefulsets + verbs: + - create + - get + - list + - watch + - delete + - update + - apiGroups: + - '' + resources: + - pods + verbs: + - get + - list + - watch + - delete + - deletecollection + - apiGroups: + - mongodbcommunity.mongodb.com + resources: + - mongodbcommunity + - mongodbcommunity/status + - mongodbcommunity/spec + - mongodbcommunity/finalizers + verbs: + - '*' + - apiGroups: + - mongodb.com + verbs: + - '*' + resources: + - mongodb + - mongodb/finalizers + - mongodbusers + - mongodbusers/finalizers + - opsmanagers + - opsmanagers/finalizers + - mongodbmulticluster + - mongodbmulticluster/finalizers + - mongodbsearch + - mongodbsearch/finalizers + - mongodb/status + - mongodbusers/status + - opsmanagers/status + - mongodbmulticluster/status + - mongodbsearch/status +--- +# Source: mongodb-kubernetes/templates/operator-roles-pvc-resize.yaml +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-pvc-resize + namespace: mongodb +rules: + - apiGroups: + - '' + resources: + - persistentvolumeclaims + verbs: + - get + - delete + - list + - watch + - patch + - update +--- +# Source: mongodb-kubernetes/templates/database-roles.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-appdb + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-appdb +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-appdb + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-base.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-operator +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator-roles-pvc-resize.yaml +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: mongodb-kubernetes-operator-pvc-resize-binding + namespace: mongodb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: mongodb-kubernetes-operator-pvc-resize +subjects: + - kind: ServiceAccount + name: mongodb-kubernetes-operator + namespace: mongodb +--- +# Source: mongodb-kubernetes/templates/operator.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mongodb-kubernetes-operator + namespace: mongodb +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: mongodb-kubernetes-operator + app.kubernetes.io/instance: mongodb-kubernetes-operator + template: + metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: mongodb-kubernetes-operator + app.kubernetes.io/instance: mongodb-kubernetes-operator + spec: + serviceAccountName: mongodb-kubernetes-operator + securityContext: + runAsNonRoot: true + runAsUser: 2000 + imagePullSecrets: + - name: prerelease-image-pullsecret + containers: + - name: mongodb-kubernetes-operator +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + image: "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes:68a83a6562a059000707301b" +======== + image: "quay.io/mongodb/staging/mongodb-kubernetes:1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2" +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + imagePullPolicy: Always + args: + - -watch-resource=mongodb + - -watch-resource=opsmanagers + - -watch-resource=mongodbusers + - -watch-resource=mongodbcommunity + - -watch-resource=mongodbsearch + - -watch-resource=clustermongodbroles + command: + - /usr/local/bin/mongodb-kubernetes-operator + resources: + limits: + cpu: 1100m + memory: 1Gi + requests: + cpu: 500m + memory: 200Mi + env: + - name: OPERATOR_ENV + value: prod + - name: MDB_DEFAULT_ARCHITECTURE + value: non-static + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: MDB_OPERATOR_TELEMETRY_COLLECTION_FREQUENCY + value: "1m" + - name: MDB_OPERATOR_TELEMETRY_SEND_ENABLED + value: "false" + - name: MDB_OPERATOR_TELEMETRY_SEND_FREQUENCY + value: "168h" + - name: CLUSTER_CLIENT_TIMEOUT + value: "10" + - name: IMAGE_PULL_POLICY + value: Always + # Database + - name: MONGODB_ENTERPRISE_DATABASE_IMAGE + value: quay.io/mongodb/staging/mongodb-kubernetes-database + - name: INIT_DATABASE_IMAGE_REPOSITORY + value: quay.io/mongodb/staging/mongodb-kubernetes-init-database + - name: INIT_DATABASE_VERSION +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + value: 68a83a6562a059000707301b + - name: DATABASE_VERSION + value: 68a83a6562a059000707301b +======== + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + - name: DATABASE_VERSION + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + # Ops Manager + - name: OPS_MANAGER_IMAGE_REPOSITORY + value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi + - name: INIT_OPS_MANAGER_IMAGE_REPOSITORY + value: quay.io/mongodb/staging/mongodb-kubernetes-init-ops-manager + - name: INIT_OPS_MANAGER_VERSION +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + value: 68a83a6562a059000707301b +======== + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + # AppDB + - name: INIT_APPDB_IMAGE_REPOSITORY + value: quay.io/mongodb/staging/mongodb-kubernetes-init-appdb + - name: INIT_APPDB_VERSION +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + value: 68a83a6562a059000707301b + - name: OPS_MANAGER_IMAGE_PULL_POLICY + value: Always + - name: AGENT_IMAGE + value: "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent:108.0.12.8846-1" +======== + value: 1.4.0-prerelease-68b5c0bb136a0d0007a4c8a2 + - name: OPS_MANAGER_IMAGE_PULL_POLICY + value: Always + - name: AGENT_IMAGE + value: "quay.io/mongodb/mongodb-agent:108.0.12.8846-1" +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + - name: MDB_AGENT_IMAGE_REPOSITORY + value: "quay.io/mongodb/mongodb-agent" + - name: MONGODB_IMAGE + value: mongodb-enterprise-server + - name: MONGODB_REPO_URL + value: quay.io/mongodb + - name: MDB_IMAGE_TYPE + value: ubi9 + - name: PERFORM_FAILOVER + value: 'true' + - name: IMAGE_PULL_SECRETS + value: prerelease-image-pullsecret + - name: MDB_MAX_CONCURRENT_RECONCILES + value: "10" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: OPERATOR_NAME + value: mongodb-kubernetes-operator + # Community Env Vars Start + - name: MDB_COMMUNITY_AGENT_IMAGE + value: "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent:108.0.2.8729-1" + - name: VERSION_UPGRADE_HOOK_IMAGE + value: "quay.io/mongodb/mongodb-kubernetes-operator-version-upgrade-post-start-hook:1.0.9" + - name: READINESS_PROBE_IMAGE + value: "quay.io/mongodb/mongodb-kubernetes-readinessprobe:1.0.22" + - name: MDB_COMMUNITY_IMAGE + value: "mongodb-community-server" + - name: MDB_COMMUNITY_REPO_URL + value: "quay.io/mongodb" + - name: MDB_COMMUNITY_IMAGE_TYPE + value: "ubi8" + # Community Env Vars End + - name: MDB_SEARCH_COMMUNITY_REPO_URL +<<<<<<<< HEAD:scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0100_install_operator.out + value: "268558157000.dkr.ecr.eu-west-1.amazonaws.com" + - name: MDB_SEARCH_COMMUNITY_NAME + value: "mongot/community" + - name: MDB_SEARCH_COMMUNITY_VERSION + value: "1.53.0-78-g227f2593f" +======== + value: "quay.io/mongodb/staging" + - name: MDB_SEARCH_COMMUNITY_NAME + value: "mongodb-search" + - name: MDB_SEARCH_COMMUNITY_VERSION + value: "latest" +>>>>>>>> fealebenpae/enterprise-search-snippets:scripts/code_snippets/tests/outputs/test_kind_search_community_snippets/01_0100_install_operator.out + diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0315_wait_for_community_resource.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0315_wait_for_community_resource.out new file mode 100644 index 000000000..97e4b8d32 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0315_wait_for_community_resource.out @@ -0,0 +1,13 @@ +Waiting for MongoDBCommunity resource to reach Running phase... +mongodbcommunity.mongodbcommunity.mongodb.com/mdbc-rs condition met + +MongoDBCommunity resource +NAME PHASE VERSION +mdbc-rs Running 8.0.10 + +Pods running in cluster kind-kind +NAME READY STATUS RESTARTS AGE +mdbc-rs-0 2/2 Running 0 2m32s +mdbc-rs-1 2/2 Running 0 96s +mdbc-rs-2 2/2 Running 0 48s +mongodb-kubernetes-operator-5d946f899b-fdfhp 1/1 Running 0 2m34s diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0330_wait_for_community_resource.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0330_wait_for_community_resource.out new file mode 100644 index 000000000..6971e0146 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0330_wait_for_community_resource.out @@ -0,0 +1,2 @@ +Waiting for MongoDBCommunity resource to reach Running phase... +mongodbcommunity.mongodbcommunity.mongodb.com/mdbc-rs condition met diff --git a/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0335_show_running_pods.out b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0335_show_running_pods.out new file mode 100644 index 000000000..65c9bbdd4 --- /dev/null +++ b/scripts/code_snippets/tests/outputs/test_kind_search_external_mongod_snippets/04_0335_show_running_pods.out @@ -0,0 +1,16 @@ + +MongoDBSearch resource +NAME PHASE AGE +mdbs Running 27s + +Search pods running in cluster kind-kind +NAME READY STATUS RESTARTS AGE +mdbs-search-0 1/1 Running 0 27s + +All pods in namespace mongodb +NAME READY STATUS RESTARTS AGE +mdbc-rs-0 2/2 Running 0 3m +mdbc-rs-1 2/2 Running 0 2m4s +mdbc-rs-2 2/2 Running 0 76s +mdbs-search-0 1/1 Running 0 27s +mongodb-kubernetes-operator-5d946f899b-fdfhp 1/1 Running 0 3m2s diff --git a/scripts/code_snippets/tests/test_kind_search_community_snippets.sh b/scripts/code_snippets/tests/test_kind_search_community_snippets.sh index fa5f12c62..522433a7a 100755 --- a/scripts/code_snippets/tests/test_kind_search_community_snippets.sh +++ b/scripts/code_snippets/tests/test_kind_search_community_snippets.sh @@ -1,19 +1,37 @@ #!/usr/bin/env bash set -eou pipefail +test "${MDB_BASH_DEBUG:-0}" -eq 1 && set -x + source scripts/dev/set_env_context.sh +script_name=$(readlink -f "${BASH_SOURCE[0]}") + +_SNIPPETS_OUTPUT_DIR="$(dirname "${script_name}")/outputs/$(basename "${script_name%.*}")" +export _SNIPPETS_OUTPUT_DIR +mkdir -p "${_SNIPPETS_OUTPUT_DIR}" + dump_logs() { - source scripts/evergreen/e2e/dump_diagnostic_information.sh - dump_all_non_default_namespaces "${K8S_CLUSTER_0_CONTEXT_NAME}" + if [[ "${SKIP_DUMP:-"false"}" != "true" ]]; then + scripts/evergreen/e2e/dump_diagnostic_information_from_all_namespaces.sh "${K8S_CTX}" + fi } trap dump_logs EXIT -test_dir="./docs/community-search/quick-start" - +test_dir="./docs/search/01-search-community-deploy" source "${test_dir}/env_variables.sh" echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor" # shellcheck disable=SC1090 test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" +${test_dir}/test.sh + +test_dir="./docs/search/03-search-query-usage" +echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor" +# shellcheck disable=SC1090 +test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" + +export MDB_RESOURCE_NAME="mdbc-rs" +export MDB_CONNECTION_STRING="mongodb://mdb-user:${MDB_USER_PASSWORD}@${MDB_RESOURCE_NAME}-0.${MDB_RESOURCE_NAME}-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=${MDB_RESOURCE_NAME}" ${test_dir}/test.sh + diff --git a/scripts/code_snippets/tests/test_kind_search_enterprise_snippets.sh b/scripts/code_snippets/tests/test_kind_search_enterprise_snippets.sh new file mode 100755 index 000000000..945053844 --- /dev/null +++ b/scripts/code_snippets/tests/test_kind_search_enterprise_snippets.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -eou pipefail +test "${MDB_BASH_DEBUG:-0}" -eq 1 && set -x + +source scripts/dev/set_env_context.sh + +script_name=$(readlink -f "${BASH_SOURCE[0]}") + +_SNIPPETS_OUTPUT_DIR="$(dirname "${script_name}")/outputs/$(basename "${script_name%.*}")" +export _SNIPPETS_OUTPUT_DIR +mkdir -p "${_SNIPPETS_OUTPUT_DIR}" + +dump_logs() { + if [[ "${SKIP_DUMP:-"false"}" != "true" ]]; then + scripts/evergreen/e2e/dump_diagnostic_information_from_all_namespaces.sh "${K8S_CTX}" + fi +} +trap dump_logs EXIT + +test_dir="./docs/search/02-search-enterprise-deploy" +source "${test_dir}/env_variables.sh" +echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor" +# shellcheck disable=SC1090 +test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" +${test_dir}/test.sh + +test_dir="./docs/search/03-search-query-usage" +echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor" +# shellcheck disable=SC1090 +test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" + +export MDB_CONNECTION_STRING="mongodb://mdb-user:${MDB_USER_PASSWORD}@${MDB_RESOURCE_NAME}-0.${MDB_RESOURCE_NAME}-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=${MDB_RESOURCE_NAME}" + +${test_dir}/test.sh diff --git a/scripts/code_snippets/tests/test_kind_search_external_mongod_snippets.sh b/scripts/code_snippets/tests/test_kind_search_external_mongod_snippets.sh new file mode 100644 index 000000000..54f8fc3ac --- /dev/null +++ b/scripts/code_snippets/tests/test_kind_search_external_mongod_snippets.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -eou pipefail +test "${MDB_BASH_DEBUG:-0}" -eq 1 && set -x + +source scripts/dev/set_env_context.sh + +script_name=$(readlink -f "${BASH_SOURCE[0]}") + +_SNIPPETS_OUTPUT_DIR="$(dirname "${script_name}")/outputs/$(basename "${script_name%.*}")" +export _SNIPPETS_OUTPUT_DIR +mkdir -p "${_SNIPPETS_OUTPUT_DIR}" + +dump_logs() { + if [[ "${SKIP_DUMP:-"false"}" != "true" ]]; then + scripts/evergreen/e2e/dump_diagnostic_information_from_all_namespaces.sh "${K8S_CTX}" + fi +} +trap dump_logs EXIT + +test_dir="./docs/search/04-search-external-mongod" +source "${test_dir}/env_variables.sh" +echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor" +# shellcheck disable=SC1090 +test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" + +export MDB_RESOURCE_NAME="mdbc-rs" +export MDB_CONNECTION_STRING="mongodb://mdb-user:${MDB_USER_PASSWORD}@${MDB_RESOURCE_NAME}-0.${MDB_RESOURCE_NAME}-svc.${MDB_NS}.svc.cluster.local:27017/?replicaSet=${MDB_RESOURCE_NAME}" + +${test_dir}/test.sh + +test_dir="./docs/search/03-search-query-usage" +echo "Sourcing env variables for ${CODE_SNIPPETS_FLAVOR} flavor" +# shellcheck disable=SC1090 +test -f "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" && source "${test_dir}/env_variables_${CODE_SNIPPETS_FLAVOR}.sh" + +${test_dir}/test.sh diff --git a/scripts/dev/contexts/prerelease_kind_code_snippets b/scripts/dev/contexts/prerelease_kind_code_snippets index d6fea1d84..4248bb9ee 100644 --- a/scripts/dev/contexts/prerelease_kind_code_snippets +++ b/scripts/dev/contexts/prerelease_kind_code_snippets @@ -12,3 +12,5 @@ source "${script_dir}/root-context" export NAMESPACE=mongodb export CODE_SNIPPETS_FLAVOR=e2e_prerelease export CODE_SNIPPETS_COMMIT_OUTPUT=true + +export PRERELEASE_IMAGE_PULLSECRET="${PRERELEASE_PULLSECRET_DOCKERCONFIGJSON}" diff --git a/scripts/dev/contexts/private-context-template b/scripts/dev/contexts/private-context-template index f1809728e..2a95eaf42 100644 --- a/scripts/dev/contexts/private-context-template +++ b/scripts/dev/contexts/private-context-template @@ -97,8 +97,7 @@ export e2e_cloud_qa_orgid_owner_static_2="${OM_ORGID}" export e2e_cloud_qa_apikey_owner_static_2="${OM_API_KEY}" export e2e_cloud_qa_user_owner_static_2="${OM_USER}" -# TODO to be removed at public preview stage of community-search -export COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON="" +export PRERELEASE_PULLSECRET_DOCKERCONFIGJSON="" # uncomment to enable license update with pre-commit script # export MDB_UPDATE_LICENSES=true diff --git a/scripts/dev/update_docs_snippets.sh b/scripts/dev/update_docs_snippets.sh index b9a45b378..bdec61db2 100755 --- a/scripts/dev/update_docs_snippets.sh +++ b/scripts/dev/update_docs_snippets.sh @@ -46,17 +46,16 @@ function prepare_repositories() { } function copy_files() { - samples_dir=$1 - dst_dir="${DOCS_DIR}/source/includes/code-examples/reference-architectures/${samples_dir}" - src_dir="${MCK_DIR}/public/architectures/${samples_dir}" + local src_dir="$1" + local dst_dir="$2" rm -rf "${dst_dir}" mkdir -p "${dst_dir}" - cp -r "${src_dir}/code_snippets" "${dst_dir}" - cp -r "${src_dir}/output" "${dst_dir}" || true - cp "${src_dir}/env_variables.sh" "${dst_dir}" || true - cp -r "${src_dir}/yamls" "${dst_dir}" || true + cp -r "${src_dir}/code_snippets" "${dst_dir}" 2>/dev/null || true + cp -r "${src_dir}/output" "${dst_dir}" 2>/dev/null || true + cp "${src_dir}/env_variables.sh" "${dst_dir}" 2>/dev/null || true + cp -r "${src_dir}/yamls" "${dst_dir}" 2>/dev/null || true } function prepare_docs_pr() { @@ -74,17 +73,26 @@ function prepare_docs_pr() { pushd ../ prepare_repositories -copy_files "ops-manager-multi-cluster" -copy_files "ops-manager-mc-no-mesh" -copy_files "mongodb-sharded-multi-cluster" -copy_files "mongodb-sharded-mc-no-mesh" -copy_files "mongodb-replicaset-multi-cluster" -copy_files "mongodb-replicaset-mc-no-mesh" -copy_files "setup-multi-cluster/verify-connectivity" -copy_files "setup-multi-cluster/setup-gke" -copy_files "setup-multi-cluster/setup-istio" -copy_files "setup-multi-cluster/setup-operator" -copy_files "setup-multi-cluster/setup-cert-manager" -copy_files "setup-multi-cluster/setup-externaldns" + +REF_ARCH_SRC_DIR="${MCK_DIR}/public/architectures" +REF_ARCH_DST_DIR="${DOCS_DIR}/source/includes/code-examples/reference-architectures" + +copy_files "${REF_ARCH_SRC_DIR}/ops-manager-multi-cluster" "${REF_ARCH_DST_DIR}/ops-manager-multi-cluster" +copy_files "${REF_ARCH_SRC_DIR}/ops-manager-mc-no-mesh" "${REF_ARCH_DST_DIR}/ops-manager-mc-no-mesh" +copy_files "${REF_ARCH_SRC_DIR}/mongodb-sharded-multi-cluster" "${REF_ARCH_DST_DIR}/mongodb-sharded-multi-cluster" +copy_files "${REF_ARCH_SRC_DIR}/mongodb-sharded-mc-no-mesh" "${REF_ARCH_DST_DIR}/mongodb-sharded-mc-no-mesh" +copy_files "${REF_ARCH_SRC_DIR}/mongodb-replicaset-multi-cluster" "${REF_ARCH_DST_DIR}/mongodb-replicaset-multi-cluster" +copy_files "${REF_ARCH_SRC_DIR}/mongodb-replicaset-mc-no-mesh" "${REF_ARCH_DST_DIR}/mongodb-replicaset-mc-no-mesh" +copy_files "${REF_ARCH_SRC_DIR}/setup-multi-cluster/verify-connectivity" "${REF_ARCH_DST_DIR}/setup-multi-cluster/verify-connectivity" +copy_files "${REF_ARCH_SRC_DIR}/setup-multi-cluster/setup-gke" "${REF_ARCH_DST_DIR}/setup-multi-cluster/setup-gke" +copy_files "${REF_ARCH_SRC_DIR}/setup-multi-cluster/setup-istio" "${REF_ARCH_DST_DIR}/setup-multi-cluster/setup-istio" +copy_files "${REF_ARCH_SRC_DIR}/setup-multi-cluster/setup-operator" "${REF_ARCH_DST_DIR}/setup-multi-cluster/setup-operator" +copy_files "${REF_ARCH_SRC_DIR}/setup-multi-cluster/setup-cert-manager" "${REF_ARCH_DST_DIR}/setup-multi-cluster/setup-cert-manager" +copy_files "${REF_ARCH_SRC_DIR}/setup-multi-cluster/setup-externaldns" "${REF_ARCH_DST_DIR}/setup-multi-cluster/setup-externaldns" + +DOCS_SNIPPETS_SRC_DIR="${MCK_DIR}/docs" +DOCS_SNIPPEES_DST_DIR="${DOCS_DIR}/source/includes/code-examples" +copy_files "${DOCS_SNIPPETS_SRC_DIR}/community-search/quick-start" "${DOCS_SNIPPEES_DST_DIR}/community-search/quick-start" + prepare_docs_pr popd