diff --git a/api/v1/search/mongodbsearch_types.go b/api/v1/search/mongodbsearch_types.go index f07f25053..d77fc9b4c 100644 --- a/api/v1/search/mongodbsearch_types.go +++ b/api/v1/search/mongodbsearch_types.go @@ -19,7 +19,7 @@ const ( MongotDefaultPort = 27027 MongotDefaultMetricsPort = 9946 MongotDefautHealthCheckPort = 8080 - MongotDefaultSyncSourceUsername = "mongot-user" + MongotDefaultSyncSourceUsername = "search-sync-source" ) func init() { @@ -27,16 +27,23 @@ func init() { } type MongoDBSearchSpec struct { + // Optional version of MongoDB Search component (mongot). If not set, then the operator will set the most appropriate version of MongoDB Search. // +optional Version string `json:"version"` + // MongoDB database connection details from which MongoDB Search will synchronize data to build indexes. // +optional Source *MongoDBSource `json:"source"` + // StatefulSetSpec which the operator will apply to the MongoDB Search StatefulSet at the end of the reconcile loop. Use to provide necessary customizations, + // which aren't exposed as fields in the MongoDBSearch.spec. // +optional StatefulSetConfiguration *common.StatefulSetConfiguration `json:"statefulSet,omitempty"` + // Configure MongoDB Search's persistent volume. If not defined, the operator will request 10GB of storage. // +optional Persistence *common.Persistence `json:"persistence,omitempty"` + // Configure resource requests and limits for the MongoDB Search pods. // +optional ResourceRequirements *corev1.ResourceRequirements `json:"resourceRequirements,omitempty"` + // Configure security settings of the MongoDB Search server that MongoDB database is connecting to when performing search queries. // +optional Security Security `json:"security"` } diff --git a/controllers/operator/mongodbsearch_controller_test.go b/controllers/operator/mongodbsearch_controller_test.go index bc9f12c91..ba3885042 100644 --- a/controllers/operator/mongodbsearch_controller_test.go +++ b/controllers/operator/mongodbsearch_controller_test.go @@ -92,7 +92,7 @@ func buildExpectedMongotConfig(search *searchv1.MongoDBSearch, mdbc *mdbcv1.Mong SyncSource: mongot.ConfigSyncSource{ ReplicaSet: mongot.ConfigReplicaSet{ HostAndPort: hostAndPorts, - Username: "mongot-user", + Username: searchv1.MongotDefaultSyncSourceUsername, PasswordFile: "/tmp/sourceUserPassword", TLS: ptr.To(false), ReadPreference: ptr.To("secondaryPreferred"), diff --git a/docker/mongodb-kubernetes-init-ops-manager/mmsconfiguration/edit_mms_configuration.go b/docker/mongodb-kubernetes-init-ops-manager/mmsconfiguration/edit_mms_configuration.go index 793914d3a..ca7b9a3b0 100755 --- a/docker/mongodb-kubernetes-init-ops-manager/mmsconfiguration/edit_mms_configuration.go +++ b/docker/mongodb-kubernetes-init-ops-manager/mmsconfiguration/edit_mms_configuration.go @@ -145,7 +145,7 @@ func readLinesFromFile(name string) ([]string, error) { func writeLinesToFile(name string, lines []string) error { output := strings.Join(lines, lineBreak) - err := os.WriteFile(name, []byte(output), 0o775) + err := os.WriteFile(name, []byte(output), 0o644) if err != nil { return xerrors.Errorf("error writing to file %s: %w", name, err) } @@ -168,7 +168,7 @@ func appendLinesToFile(name string, lines string) error { func getOmPropertiesFromEnvVars() map[string]string { props := map[string]string{} - for _, pair := range os.Environ() { + for _, pair := range os.Environ() { // nolint:forbidigo if !strings.HasPrefix(pair, omPropertyPrefix) { continue } diff --git a/docker/mongodb-kubernetes-tests/tests/search/fixtures/community-replicaset-sample-mflix.yaml b/docker/mongodb-kubernetes-tests/tests/search/fixtures/community-replicaset-sample-mflix.yaml index 490ad3304..fe54d614d 100644 --- a/docker/mongodb-kubernetes-tests/tests/search/fixtures/community-replicaset-sample-mflix.yaml +++ b/docker/mongodb-kubernetes-tests/tests/search/fixtures/community-replicaset-sample-mflix.yaml @@ -4,59 +4,66 @@ kind: MongoDBCommunity metadata: name: mdbc-rs spec: - members: 3 + version: 8.0.10 type: ReplicaSet - version: "8.0.10" + members: 3 security: authentication: - modes: ["SCRAM-SHA-1"] + ignoreUnknownUsers: true + modes: + - SCRAM agent: logLevel: DEBUG + statefulSet: + spec: + template: + spec: + containers: + - name: mongod + resources: + limits: + cpu: "2" + memory: 2Gi + requests: + cpu: "1" + memory: 1Gi + - name: mongodb-agent + resources: + limits: + cpu: "1" + memory: 2Gi + requests: + cpu: "0.5" + memory: 1Gi users: + # admin user with root role - name: mdb-admin db: admin - passwordSecretRef: # a reference to the secret that will be used to generate the user's password + passwordSecretRef: # a reference to the secret containing user password name: mdb-admin-user-password + scramCredentialsSecretName: mdb-admin-user roles: - name: root db: admin - scramCredentialsSecretName: mdb-admin-user-scram + # user performing search queries - name: mdb-user db: admin - passwordSecretRef: # a reference to the secret that will be used to generate the user's password + passwordSecretRef: # a reference to the secret containing user password name: mdb-user-password + scramCredentialsSecretName: mdb-user-scram roles: - name: restore db: sample_mflix - name: readWrite db: sample_mflix - scramCredentialsSecretName: mdb-user-scram - - name: mongot-user + # 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. + - name: search-sync-source db: admin passwordSecretRef: # a reference to the secret that will be used to generate the user's password - name: mdbc-rs-mongot-user-password + name: mdbc-rs-search-sync-source-password + scramCredentialsSecretName: mdbc-rs-search-sync-source roles: - name: searchCoordinator db: admin - scramCredentialsSecretName: mongot-user-scram - statefulSet: - spec: - template: - spec: - containers: - - name: mongod - resources: - limits: - cpu: "3" - memory: 5Gi - requests: - cpu: "2" - memory: 5Gi - - name: mongodb-agent - resources: - limits: - cpu: "3" - memory: 5Gi - requests: - cpu: "2" - memory: 5Gi diff --git a/docker/mongodb-kubernetes-tests/tests/search/search_community_basic.py b/docker/mongodb-kubernetes-tests/tests/search/search_community_basic.py index 3d4953913..97e9c1af7 100644 --- a/docker/mongodb-kubernetes-tests/tests/search/search_community_basic.py +++ b/docker/mongodb-kubernetes-tests/tests/search/search_community_basic.py @@ -15,8 +15,8 @@ ADMIN_USER_NAME = "mdb-admin-user" ADMIN_USER_PASSWORD = "mdb-admin-user-pass" -MONGOT_USER_NAME = "mongot-user" -MONGOT_USER_PASSWORD = "mongot-user-password" +MONGOT_USER_NAME = "search-sync-source" +MONGOT_USER_PASSWORD = "search-sync-source-user-password" USER_NAME = "mdb-user" USER_PASSWORD = "mdb-user-pass" @@ -32,8 +32,8 @@ def mdbc(namespace: str) -> MongoDBCommunity: namespace=namespace, ) - # if try_load(resource): - # return resource + if try_load(resource): + return resource return resource @@ -45,8 +45,8 @@ def mdbs(namespace: str) -> MongoDBSearch: namespace=namespace, ) - # if try_load(resource): - # return resource + if try_load(resource): + return resource return resource @@ -75,7 +75,7 @@ def test_create_database_resource(mdbc: MongoDBCommunity): @mark.e2e_search_community_basic -def test_create_search_resource(mdbs: MongoDBSearch, mdbc: MongoDBCommunity): +def test_create_search_resource(mdbs: MongoDBSearch): mdbs.update() mdbs.assert_reaches_phase(Phase.Running, timeout=300) @@ -102,11 +102,6 @@ def test_search_create_search_index(sample_movies_helper: SampleMoviesSearchHelp sample_movies_helper.create_search_index() -# @mark.e2e_search_community_basic -# def test_search_wait_for_search_indexes(sample_movies_helper: SampleMoviesSearchHelper): -# sample_movies_helper.wait_for_search_indexes() - - @mark.e2e_search_community_basic def test_search_assert_search_query(sample_movies_helper: SampleMoviesSearchHelper): sample_movies_helper.assert_search_query(retry_timeout=60) diff --git a/docker/mongodb-kubernetes-tests/tests/search/search_community_tls.py b/docker/mongodb-kubernetes-tests/tests/search/search_community_tls.py index aa0c53e79..44418b793 100644 --- a/docker/mongodb-kubernetes-tests/tests/search/search_community_tls.py +++ b/docker/mongodb-kubernetes-tests/tests/search/search_community_tls.py @@ -17,8 +17,8 @@ ADMIN_USER_NAME = "mdb-admin-user" ADMIN_USER_PASSWORD = "mdb-admin-user-pass" -MONGOT_USER_NAME = "mongot-user" -MONGOT_USER_PASSWORD = "mongot-user-password" +MONGOT_USER_NAME = "search-sync-source" +MONGOT_USER_PASSWORD = "search-sync-source-user-password" USER_NAME = "mdb-user" USER_PASSWORD = "mdb-user-pass" diff --git a/docs/community-search/quick-start/README.md b/docs/community-search/quick-start/README.md index 3934db1ab..7f6b6af99 100644 --- a/docs/community-search/quick-start/README.md +++ b/docs/community-search/quick-start/README.md @@ -4,11 +4,9 @@ This guide provides instructions for deploying MongoDB Community Edition along w ## 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). +- **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. @@ -29,15 +27,18 @@ Download or copy the content of `env_variables.sh`: # 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" +# 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" -export MDB_SEARCH_USER_PASSWORD="search-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 OPERATOR_HELM_CHART="mongodb/mongodb-kubernetes" # comma-separated key=value pairs for additional parameters passed to the helm-chart installing the operator @@ -69,83 +70,39 @@ helm upgrade --install --debug --kube-context "${K8S_CLUSTER_0_CONTEXT_NAME}" \ --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 +mongosh --quiet "mongodb://mdb-user:${MDB_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 index 0e3125075..de32c88b1 100644 --- a/docs/community-search/quick-start/README.md.j2 +++ b/docs/community-search/quick-start/README.md.j2 @@ -4,11 +4,9 @@ This guide provides instructions for deploying MongoDB Community Edition along w ## 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). +- **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. @@ -47,33 +45,13 @@ Next, install the MongoDB Kubernetes Operator from the Helm repository you just ```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`. +This command installs the operator in the `mongodb` namespace (creating it if it doesn't exist). ## 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 +### 4. 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. @@ -83,16 +61,19 @@ MongoDB requires authentication for secure access. This step creates two Kuberne ``` Ensure these secrets are created in the same namespace where you plan to deploy MongoDB. -### 7. Create MongoDB Community Resource +### 5. 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. +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.10. MongoDB Community Search is supported only from MongoDB Community Server version 8.0.10. It also defines CPU and memory resources for the `mongod` and `mongodb-agent` containers, and sets up three users: +* `mdb-user` - a regular user used to that will perform restore of `sample_mflix` database and execute search queries. +* `search-sync-source` - user that MongoDB Search is using to connect to MongoDB database in order to manage and build indexes. This user uses `searchCoordinator` role, which for MongoDB <8.2 is created automatically by the operator. +* `admin-user` and ``) 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 +### 6. 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. @@ -101,13 +82,12 @@ After applying the `MongoDBCommunity` custom resource, the operator begins deplo {% include "code_snippets/0315_wait_for_community_resource.sh" %} ``` -### 9. Create MongoDB Search Resource +### 7. 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) +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 @@ -126,7 +106,7 @@ requests: memory: 2G ``` -### 10. Wait for Search Resource to be Ready +### 8. 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. @@ -136,7 +116,7 @@ Similar to the MongoDB deployment, the Search deployment needs time to initializ ``` This command polls the status of the `MongoDBSearch` resource `mdbc-rs`. -### 11. Verify MongoDB Community Resource Status +### 9. 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. @@ -146,7 +126,7 @@ Double-check the status of your `MongoDBCommunity` resource to ensure it remains ``` This provides a final confirmation that the core database is operational. -### 12. List Running Pods +### 10. 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. @@ -159,7 +139,7 @@ View all the running pods in your namespace. You should see pods for the MongoDB Now that your MongoDB Community database with Search is deployed, you can start using its search capabilities. -### 13. Deploy MongoDB Tools Pod +### 11. 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). @@ -168,7 +148,7 @@ To interact with your MongoDB deployment, this step deploys a utility pod named {% include "code_snippets/0410_run_mongodb_tools_pod.sh" %} ``` -### 14. Import Sample Data +### 12. 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`. @@ -178,7 +158,7 @@ To test the search functionality, this step imports the `sample_mflix.movies` co ``` This command uses `mongorestore` from the `mongodb-tools-pod` to load data from the downloaded `sample_mflix.archive` file. -### 15. Create Search Index +### 13. 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. @@ -187,7 +167,7 @@ Before performing search queries, create a search index. This step uses `kubectl {% include "code_snippets/0430_create_search_index.sh" %} ``` -### 16. Wait for Search Index to be Ready +### 14. 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")`. @@ -196,7 +176,7 @@ Creating a search index is an asynchronous operation. This script polls periodic {% include "code_snippets/0440_wait_for_search_index_ready.sh" %} ``` -### 17. Execute a Search Query +### 15. 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. diff --git a/docs/community-search/quick-start/code_snippets/0100_install_operator.sh b/docs/community-search/quick-start/code_snippets/0100_install_operator.sh old mode 100644 new mode 100755 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 "mongodb://mdb-user:${MDB_USER_PASSWORD}@mdbc-rs-0.mdbc-rs-svc.${MDB_NAMESPACE}.svc.cluster.local:27017/?replicaSet=mdbc-rs" < /tmp/mdb_script.js EOF )" diff --git a/docs/community-search/quick-start/code_snippets/090_helm_add_mogodb_repo.sh b/docs/community-search/quick-start/code_snippets/090_helm_add_mogodb_repo.sh old mode 100644 new mode 100755 diff --git a/docs/community-search/quick-start/code_snippets/9010_delete_namespace.sh b/docs/community-search/quick-start/code_snippets/9010_delete_namespace.sh old mode 100644 new mode 100755 index 96db9a4b6..ed2d3046d --- a/docs/community-search/quick-start/code_snippets/9010_delete_namespace.sh +++ b/docs/community-search/quick-start/code_snippets/9010_delete_namespace.sh @@ -1 +1 @@ -kubectl --context +kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" delete namespace "${MDB_NAMESPACE}" diff --git a/docs/community-search/quick-start/community_search_snippets_test.sh.run.log b/docs/community-search/quick-start/community_search_snippets_test.sh.run.log deleted file mode 100644 index 643009e51..000000000 --- a/docs/community-search/quick-start/community_search_snippets_test.sh.run.log +++ /dev/null @@ -1,16 +0,0 @@ -090_helm_add_mogodb_repo -0100_install_operator -0200_configure_community_search_pullsecret -0210_verify_community_search_pullsecret -0305_create_mongodb_community_user_secrets -0310_create_mongodb_community_resource -0315_wait_for_community_resource -0320_create_mongodb_search_resource -0325_wait_for_search_resource -0330_wait_for_community_resource -0335_show_running_pods -0410_run_mongodb_tools_pod -0420_import_movies_mflix_database -0430_create_search_index -0440_wait_for_search_index_ready -0450_execute_search_query diff --git a/docs/community-search/quick-start/env_variables.sh b/docs/community-search/quick-start/env_variables.sh index 0d0a98a5f..613b1461b 100644 --- a/docs/community-search/quick-start/env_variables.sh +++ b/docs/community-search/quick-start/env_variables.sh @@ -1,15 +1,18 @@ # 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" +# 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" -export MDB_SEARCH_USER_PASSWORD="search-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 OPERATOR_HELM_CHART="mongodb/mongodb-kubernetes" # comma-separated key=value pairs for additional parameters passed to the helm-chart installing the operator diff --git a/docs/community-search/quick-start/env_variables_e2e_private.sh b/docs/community-search/quick-start/env_variables_e2e_private.sh index 7996f92a9..5b528437c 100644 --- a/docs/community-search/quick-start/env_variables_e2e_private.sh +++ b/docs/community-search/quick-start/env_variables_e2e_private.sh @@ -1,8 +1,7 @@ export K8S_CLUSTER_0_CONTEXT_NAME="${CLUSTER_NAME}" -export PRIVATE_PREVIEW_IMAGE_PULLSECRET="${COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON}" - -source scripts/funcs/operator_deployment +source "${PROJECT_DIR}/scripts/funcs/operator_deployment" +source "${PROJECT_DIR}/scripts/dev/contexts/e2e_mdb_community" OPERATOR_ADDITIONAL_HELM_VALUES="$(get_operator_helm_values | tr ' ' ',')" export OPERATOR_ADDITIONAL_HELM_VALUES export OPERATOR_HELM_CHART="${PROJECT_DIR}/helm_chart" diff --git a/docs/community-search/quick-start/env_variables_e2e_private_dev.sh b/docs/community-search/quick-start/env_variables_e2e_private_dev.sh new file mode 100644 index 000000000..89f8a3932 --- /dev/null +++ b/docs/community-search/quick-start/env_variables_e2e_private_dev.sh @@ -0,0 +1,33 @@ +export K8S_CLUSTER_0_CONTEXT_NAME="kind-kind" + +# patch id from evergreen patch +version_id="68876175f5ad6d0007fdc1d4" + +search_image_repo="268558157000.dkr.ecr.eu-west-1.amazonaws.com/mongot" +search_image_hash="fbd60fb055dd500058edcb45677ea85d19421f47" + +ecr="268558157000.dkr.ecr.us-east-1.amazonaws.com" +declare -a helm_values=( +"registry.imagePullSecrets=image-registries-secret" +"registry.operator=${ecr}/dev" +"registry.initOpsManager=${ecr}/dev" +"registry.initAppDb=${ecr}/dev" +"registry.initDatabase=${ecr}/dev" +"registry.agent=${ecr}/dev" +"registry.opsManager=quay.io/mongodb" +"registry.appDb=quay.io/mongodb" +"registry.database=${ecr}/dev" +"operator.version=${version_id}" +"initOpsManager.version=${version_id}" +"initAppDb.version=${version_id}" +"initDatabase.version=${version_id}" +"database.version=${version_id}" +"search.community.repo=${search_image_repo}" +"search.community.name=community" +"search.community.version=${search_image_hash}" +) + +OPERATOR_ADDITIONAL_HELM_VALUES="$(echo -n "${helm_values[@]}" | tr ' ' ',')" +export OPERATOR_ADDITIONAL_HELM_VALUES +OPERATOR_HELM_CHART="$(realpath "../../../helm_chart")" +export OPERATOR_HELM_CHART diff --git a/docs/community-search/quick-start/output/0100_install_operator.out b/docs/community-search/quick-start/output/0100_install_operator.out index 035e24e8a..95eb4ab71 100644 --- a/docs/community-search/quick-start/output/0100_install_operator.out +++ b/docs/community-search/quick-start/output/0100_install_operator.out @@ -1,12 +1,36 @@ Release "mongodb-kubernetes" does not exist. Installing it now. NAME: mongodb-kubernetes -LAST DEPLOYED: Tue Jul 8 07:04:51 2025 +LAST DEPLOYED: Mon Jul 28 15:07:59 2025 NAMESPACE: mongodb STATUS: deployed REVISION: 1 TEST SUITE: None USER-SUPPLIED VALUES: -dummy: value +database: + version: 68876175f5ad6d0007fdc1d4 +initAppDb: + version: 68876175f5ad6d0007fdc1d4 +initDatabase: + version: 68876175f5ad6d0007fdc1d4 +initOpsManager: + version: 68876175f5ad6d0007fdc1d4 +operator: + version: 68876175f5ad6d0007fdc1d4 +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: community + repo: 268558157000.dkr.ecr.eu-west-1.amazonaws.com/mongot + version: fbd60fb055dd500058edcb45677ea85d19421f47 COMPUTED VALUES: agent: @@ -39,17 +63,16 @@ community: version: 4.4.0 database: name: mongodb-kubernetes-database - version: 1.2.0 -dummy: value + version: 68876175f5ad6d0007fdc1d4 initAppDb: name: mongodb-kubernetes-init-appdb - version: 1.2.0 + version: 68876175f5ad6d0007fdc1d4 initDatabase: name: mongodb-kubernetes-init-database - version: 1.2.0 + version: 68876175f5ad6d0007fdc1d4 initOpsManager: name: mongodb-kubernetes-init-ops-manager - version: 1.2.0 + version: 68876175f5ad6d0007fdc1d4 managedSecurityContext: false mongodb: appdbAssumeOldFormat: false @@ -96,7 +119,7 @@ operator: vaultSecretBackend: enabled: false tlsSecretRef: "" - version: 1.2.0 + version: 68876175f5ad6d0007fdc1d4 watchedResources: - mongodb - opsmanagers @@ -112,24 +135,23 @@ readinessProbe: name: mongodb-kubernetes-readinessprobe version: 1.0.22 registry: - agent: quay.io/mongodb + agent: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev 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 + 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 pullPolicy: Always readinessProbe: quay.io/mongodb versionUpgradeHook: quay.io/mongodb search: community: - name: mongodb-search-community - repo: quay.io/mongodb - version: 1.47.0 -subresourceEnabled: true + name: community + repo: 268558157000.dkr.ecr.eu-west-1.amazonaws.com/mongot + version: fbd60fb055dd500058edcb45677ea85d19421f47 versionUpgradeHook: name: mongodb-kubernetes-operator-version-upgrade-post-start-hook version: 1.0.9 @@ -143,6 +165,8 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-appdb namespace: mongodb +imagePullSecrets: + - name: image-registries-secret --- # Source: mongodb-kubernetes/templates/database-roles.yaml apiVersion: v1 @@ -150,6 +174,8 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-database-pods namespace: mongodb +imagePullSecrets: + - name: image-registries-secret --- # Source: mongodb-kubernetes/templates/database-roles.yaml apiVersion: v1 @@ -157,6 +183,8 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-ops-manager namespace: mongodb +imagePullSecrets: + - name: image-registries-secret --- # Source: mongodb-kubernetes/templates/operator-sa.yaml apiVersion: v1 @@ -164,8 +192,10 @@ kind: ServiceAccount metadata: name: mongodb-kubernetes-operator namespace: mongodb +imagePullSecrets: + - name: image-registries-secret --- -# Source: mongodb-kubernetes/templates/operator-roles.yaml +# Source: mongodb-kubernetes/templates/operator-roles-clustermongodbroles.yaml kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -178,34 +208,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 @@ -233,7 +236,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: @@ -247,30 +277,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 @@ -298,7 +328,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: @@ -378,7 +408,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: @@ -406,7 +443,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: @@ -421,6 +458,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 @@ -445,9 +497,11 @@ spec: securityContext: runAsNonRoot: true runAsUser: 2000 + imagePullSecrets: + - name: image-registries-secret containers: - name: mongodb-kubernetes-operator - image: "quay.io/mongodb/mongodb-kubernetes:1.2.0" + image: "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes:68876175f5ad6d0007fdc1d4" imagePullPolicy: Always args: - -watch-resource=mongodb @@ -488,31 +542,31 @@ spec: value: Always # Database - name: MONGODB_ENTERPRISE_DATABASE_IMAGE - value: quay.io/mongodb/mongodb-kubernetes-database + value: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-database - name: INIT_DATABASE_IMAGE_REPOSITORY - value: quay.io/mongodb/mongodb-kubernetes-init-database + value: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-init-database - name: INIT_DATABASE_VERSION - value: 1.2.0 + value: 68876175f5ad6d0007fdc1d4 - name: DATABASE_VERSION - value: 1.2.0 + value: 68876175f5ad6d0007fdc1d4 # 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: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-init-ops-manager - name: INIT_OPS_MANAGER_VERSION - value: 1.2.0 + value: 68876175f5ad6d0007fdc1d4 # AppDB - name: INIT_APPDB_IMAGE_REPOSITORY - value: quay.io/mongodb/mongodb-kubernetes-init-appdb + value: 268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-kubernetes-init-appdb - name: INIT_APPDB_VERSION - value: 1.2.0 + value: 68876175f5ad6d0007fdc1d4 - name: OPS_MANAGER_IMAGE_PULL_POLICY value: Always - name: AGENT_IMAGE - value: "quay.io/mongodb/mongodb-agent-ubi:108.0.2.8729-1" + value: "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi:108.0.2.8729-1" - name: MDB_AGENT_IMAGE_REPOSITORY - value: "quay.io/mongodb/mongodb-agent-ubi" + value: "268558157000.dkr.ecr.us-east-1.amazonaws.com/dev/mongodb-agent-ubi" - name: MONGODB_IMAGE value: mongodb-enterprise-server - name: MONGODB_REPO_URL @@ -521,6 +575,8 @@ spec: value: ubi8 - name: PERFORM_FAILOVER value: 'true' + - name: IMAGE_PULL_SECRETS + value: image-registries-secret - name: MDB_MAX_CONCURRENT_RECONCILES value: "1" - name: POD_NAME @@ -544,9 +600,9 @@ spec: value: "ubi8" # Community Env Vars End - name: MDB_SEARCH_COMMUNITY_REPO_URL - value: "quay.io/mongodb" + value: "268558157000.dkr.ecr.eu-west-1.amazonaws.com/mongot" - name: MDB_SEARCH_COMMUNITY_NAME - value: "mongodb-search-community" + value: "community" - name: MDB_SEARCH_COMMUNITY_VERSION - value: "1.47.0" + value: "fbd60fb055dd500058edcb45677ea85d19421f47" diff --git a/docs/community-search/quick-start/output/0200_configure_community_search_pullsecret.out b/docs/community-search/quick-start/output/0200_configure_community_search_pullsecret.out deleted file mode 100644 index c04db5317..000000000 --- a/docs/community-search/quick-start/output/0200_configure_community_search_pullsecret.out +++ /dev/null @@ -1,18 +0,0 @@ -secret/community-private-preview-pullsecret created -serviceaccount/mongodb-kubernetes-database-pods patched -ServiceAccount mongodb-kubernetes-database-pods has been patched: -apiVersion: v1 -imagePullSecrets: -- name: community-private-preview-pullsecret -kind: ServiceAccount -metadata: - annotations: - meta.helm.sh/release-name: mongodb-kubernetes - meta.helm.sh/release-namespace: mongodb - creationTimestamp: "2025-07-08T07:04:51Z" - labels: - app.kubernetes.io/managed-by: Helm - name: mongodb-kubernetes-database-pods - namespace: mongodb - resourceVersion: "902" - uid: 69ba91c9-2032-48dd-8490-b1b6b1c82625 diff --git a/docs/community-search/quick-start/output/0210_verify_community_search_pullsecret.out b/docs/community-search/quick-start/output/0210_verify_community_search_pullsecret.out deleted file mode 100644 index 80aafdc2d..000000000 --- a/docs/community-search/quick-start/output/0210_verify_community_search_pullsecret.out +++ /dev/null @@ -1,3 +0,0 @@ -Verifying mongodb-kubernetes-database-pods service account contains proper pull secret -{"name":"community-private-preview-pullsecret"} -SUCCESS: mongodb-kubernetes-database-pods service account contains proper pull secret diff --git a/docs/community-search/quick-start/output/0335_show_running_pods.out b/docs/community-search/quick-start/output/0335_show_running_pods.out index bca15125b..cd7017404 100644 --- a/docs/community-search/quick-start/output/0335_show_running_pods.out +++ b/docs/community-search/quick-start/output/0335_show_running_pods.out @@ -1,16 +1,20 @@ MongoDBCommunity resource NAME PHASE VERSION -mdbc-rs Running 8.0.6 +mdbc-rs Running 8.0.10 MongoDBSearch resource NAME PHASE AGE -mdbc-rs Running 5m21s +mdbc-rs Running 7m58s Pods running in cluster kind-kind NAME READY STATUS RESTARTS AGE -mdbc-rs-0 2/2 Running 1 (35s ago) 7m51s -mdbc-rs-1 2/2 Running 1 (3m11s ago) 6m45s -mdbc-rs-2 2/2 Running 1 (114s ago) 5m57s -mdbc-rs-search-0 1/1 Running 0 5m21s -mongodb-kubernetes-operator-64d5b47b46-fd6nr 1/1 Running 0 7m54s +mdb-debug-mdbc-rs-0-0 1/1 Running 0 10m +mdb-debug-mdbc-rs-1-0 1/1 Running 0 10m +mdb-debug-mdbc-rs-2-0 1/1 Running 0 10m +mdb-debug-mdbc-rs-search-0-0 1/1 Running 0 7m57s +mdbc-rs-0 2/2 Running 1 (3m13s ago) 10m +mdbc-rs-1 2/2 Running 1 (5m49s ago) 9m23s +mdbc-rs-2 2/2 Running 1 (4m32s ago) 8m35s +mdbc-rs-search-0 1/1 Running 0 25s +mongodb-kubernetes-operator-5776c8b4df-wm82f 1/1 Running 0 35s diff --git a/docs/community-search/quick-start/output/0440_wait_for_search_index_ready.out b/docs/community-search/quick-start/output/0440_wait_for_search_index_ready.out index 17d0d593b..b264580af 100644 --- a/docs/community-search/quick-start/output/0440_wait_for_search_index_ready.out +++ b/docs/community-search/quick-start/output/0440_wait_for_search_index_ready.out @@ -1,4 +1 @@ -Search index is not ready yet: status=BUILDING -Search index is not ready yet: status=BUILDING -Search index is not ready yet: status=BUILDING -Search index is ready. +Sleeping to wait for search indexes to be created diff --git a/docs/community-search/quick-start/output/090_helm_add_mogodb_repo.out b/docs/community-search/quick-start/output/090_helm_add_mogodb_repo.out index e8630fdff..b1576c236 100644 --- a/docs/community-search/quick-start/output/090_helm_add_mogodb_repo.out +++ b/docs/community-search/quick-start/output/090_helm_add_mogodb_repo.out @@ -1,4 +1,4 @@ -"mongodb" has been added to your repositories +"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!⎈ diff --git a/docs/community-search/quick-start/test.sh b/docs/community-search/quick-start/test.sh index 15caf5fe4..86fb6b23e 100755 --- a/docs/community-search/quick-start/test.sh +++ b/docs/community-search/quick-start/test.sh @@ -5,7 +5,7 @@ set -eou pipefail script_name=$(readlink -f "${BASH_SOURCE[0]}") script_dir=$(dirname "${script_name}") -source scripts/code_snippets/sample_test_runner.sh +source "${script_dir}/../../../scripts/code_snippets/sample_test_runner.sh" cd "${script_dir}" @@ -16,8 +16,6 @@ run 0046_create_image_pull_secrets.sh run_for_output 090_helm_add_mogodb_repo.sh run_for_output 0100_install_operator.sh -run_for_output 0200_configure_community_search_pullsecret.sh -run_for_output 0210_verify_community_search_pullsecret.sh run 0305_create_mongodb_community_user_secrets.sh run 0310_create_mongodb_community_resource.sh run 0315_wait_for_community_resource.sh diff --git a/scripts/code_snippets/task_kind_community_search_snippets_test.sh b/scripts/code_snippets/task_kind_community_search_snippets_test.sh index 4b4501c2c..4f23a3e37 100755 --- a/scripts/code_snippets/task_kind_community_search_snippets_test.sh +++ b/scripts/code_snippets/task_kind_community_search_snippets_test.sh @@ -5,7 +5,9 @@ source scripts/dev/set_env_context.sh dump_logs() { source scripts/evergreen/e2e/dump_diagnostic_information.sh - dump_all_non_default_namespaces "$@" + if [[ "${SKIP_DUMP:-"false"}" != "true" ]]; then + dump_all_non_default_namespaces "$@" + fi } trap dump_logs EXIT diff --git a/scripts/dev/contexts/private_kind_code_snippets b/scripts/dev/contexts/private_kind_code_snippets index 704957a6f..970f0dc3f 100644 --- a/scripts/dev/contexts/private_kind_code_snippets +++ b/scripts/dev/contexts/private_kind_code_snippets @@ -8,6 +8,7 @@ script_name=$(readlink -f "${BASH_SOURCE[0]}") script_dir=$(dirname "${script_name}") source "${script_dir}/root-context" +source "${script_dir}/e2e_mdb_community" export NAMESPACE=mongodb export CODE_SNIPPETS_FLAVOR=e2e_private diff --git a/scripts/dev/contexts/root-context b/scripts/dev/contexts/root-context index 6ec7c7a61..ddae31401 100644 --- a/scripts/dev/contexts/root-context +++ b/scripts/dev/contexts/root-context @@ -6,7 +6,8 @@ script_name=$(readlink -f "${BASH_SOURCE[0]}") script_dir=$(dirname "${script_name}") source "${script_dir}/private-context" -export PROJECT_DIR="${PWD}" +PROJECT_DIR="$(realpath "${script_dir}/../../..")" +export PROJECT_DIR export IMAGE_TYPE=ubi export UBI_IMAGE_WITHOUT_SUFFIX=true export WATCH_NAMESPACE=${WATCH_NAMESPACE:-${NAMESPACE}} @@ -36,7 +37,7 @@ fi export OPERATOR_ENV=${OPERATOR_ENV:-"dev"} -AGENT_VERSION="$(jq -r '.agentVersion' release.json)" +AGENT_VERSION="$(jq -r '.agentVersion' "${PROJECT_DIR}/release.json")" export AGENT_VERSION export AGENT_IMAGE="${MDB_AGENT_IMAGE_REPOSITORY}:${AGENT_VERSION}" @@ -112,7 +113,7 @@ export MDB_COMMUNITY_REPO_URL=quay.io/mongodb export MDB_COMMUNITY_AGENT_IMAGE=${AGENT_IMAGE} export MDB_COMMUNITY_IMAGE_TYPE=ubi8 -MDB_SEARCH_COMMUNITY_VERSION="$(jq -r '.search.community.version' release.json)" +MDB_SEARCH_COMMUNITY_VERSION="$(jq -r '.search.community.version' "${PROJECT_DIR}/release.json")" export MDB_SEARCH_COMMUNITY_VERSION export MDB_SEARCH_COMMUNITY_NAME="mongodb-search-community" 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 diff --git a/scripts/funcs/operator_deployment b/scripts/funcs/operator_deployment index 88a0eed0d..55f690546 100644 --- a/scripts/funcs/operator_deployment +++ b/scripts/funcs/operator_deployment @@ -34,9 +34,9 @@ get_operator_helm_values() { "operator.telemetry.send.enabled=${MDB_OPERATOR_TELEMETRY_SEND_ENABLED:-false}" # lets collect and save in the configmap as frequently as we can "operator.telemetry.collection.frequency=${MDB_OPERATOR_TELEMETRY_COLLECTION_FREQUENCY:-1m}" - "search.community.version=${MDB_SEARCH_COMMUNITY_VERSION}" - "search.community.name=${MDB_SEARCH_COMMUNITY_NAME}" "search.community.repo=${MDB_SEARCH_COMMUNITY_REPO_URL}" + "search.community.name=${MDB_SEARCH_COMMUNITY_NAME}" + "search.community.version=${MDB_SEARCH_COMMUNITY_VERSION}" ) if [[ "${MDB_OPERATOR_TELEMETRY_INSTALL_CLUSTER_ROLE_INSTALLATION:-}" != "" ]]; then