Skip to content

Conversation

@anandsyncs
Copy link
Contributor

@anandsyncs anandsyncs commented Nov 6, 2025

Summary

Why: Making Search snippets with TLS-First

Our MongoDB Search snippets guide previously deployed without TLS. This PR overhauls them to be "TLS-first," adding and automating end-to-end encryption by default.

What's Changing:

  1. Integrates cert-manager to automatically install, bootstrap a self-signed CA, and issue all TLS certificates for MongoDB and MongoDBSearch.
  2. All resource manifests are updated to require and reference the new TLS secrets and CA.
  3. Replaces all hardcoded resource names, member counts, and secret names with environment variables (e.g., $RESOURCE_NAME).
  4. Adds validation scripts to check for required variables before deployment.

Proof of Work

Tests pass

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@lsierant lsierant force-pushed the anandsyncs/mck-search-enterprise-snippets-update branch from fed0f08 to 922ba4c Compare November 6, 2025 19:34
@lsierant lsierant changed the base branch from anandsyncs/add-certmanager-community-search-snippets to master November 6, 2025 19:34
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.6.0 Release Notes

New Features

  • MongoDBCommunity: Added support to configure custom cluster domain via newly introduced spec.clusterDomain resource field. If spec.clusterDomain is not set, environment variable CLUSTER_DOMAIN is used as cluster domain. If the environment variable CLUSTER_DOMAIN is also not set, operator falls back to cluster.local as default cluster domain.
  • Helm Chart: Introduced two new helm fields operator.podSecurityContext and operator.securityContext that can be used to configure securityContext for Operator deployment through Helm Chart.
  • MongoDBSearch: Switch to gRPC and mTLS for internal communication
    Since MCK 1.4 the mongod and mongot processess communicated using the MongoDB Wire Protocol and used keyfile authentication. This release switches that to gRPC with mTLS authentication. gRPC will allow for load-balancing search queries against multiple mongot processes in the future, and mTLS decouples the internal cluster authentication mode and credentials among mongod processes from the connection to the mongot process. The Operator will automatically enable gRPC for existing and new workloads, and will enable mTLS authentication if both Database Server and MongoDBSearch resource are configured for TLS.
  • MongoDBSearch: MongoDB deployments using X509 internal cluster authentication are now supported. Previously MongoDB Search required SCRAM authentication among members of a MongoDB replica set. Note: SCRAM client authentication is still required, this change merely relaxes the requirements on internal cluster authentication.
  • MongoDBSearch: Updated the default mongodb/mongodb-search image version to 0.55.0. This is the version MCK uses if .spec.version is not specified.

Bug Fixes

  • Fixed parsing of the customEnvVars Helm value when values contain = characters.
  • ReplicaSet: Blocked disabling TLS and changing member count simultaneously. These operations must now be applied separately to prevent configuration inconsistencies.

Other Changes

  • Simplified MongoDB Search setup: Removed the custom Search Coordinator polyfill (a piece of compatibility code previously needed to add the required permissions), as MongoDB 8.2.0 and later now include the necessary permissions via the built-in searchCoordinator role.
  • kubectl-mongodb plugin: cosign, the signing tool that is used to sign kubectl-mongodb plugin binaries, has been updated to version 3.0.2. With this change, released binaries will be bundled with .bundle files containing both signature and certificate information. For more information on how to verify signatures using new cosign version please refer to -> https://github.com/sigstore/cosign/blob/v3.0.2/doc/cosign_verify-blob.md

@lsierant lsierant force-pushed the anandsyncs/mck-search-enterprise-snippets-update branch from 6823713 to 52a2909 Compare November 7, 2025 07:49

mongotModification := func(config *mongot.Config) {
config.SyncSource.ReplicaSet.TLS = ptr.To(true)
config.SyncSource.CertificateAuthorityFile = ptr.To(tls.CAMountPath + "/" + tlsSourceConfig.CAFileName)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not really related to snippets and it's a simple fix removing doubled // in mongot config.

@lsierant lsierant force-pushed the anandsyncs/mck-search-enterprise-snippets-update branch from 52a2909 to ca9d756 Compare November 7, 2025 09:00
…-snippets-update' into anandsyncs/mck-search-enterprise-snippets-update

# Conflicts:
#	docs/search/01-search-community-deploy/code_snippets/01_0040_validate_env.sh
#	docs/search/01-search-community-deploy/code_snippets/01_0308_issue_tls_certificates.sh
#	docs/search/02-search-enterprise-deploy/code_snippets/02_0040_validate_env.sh
@anandsyncs anandsyncs changed the title Enterprise Search TLS and cert manager changes CLOUDP-353164: Community/Enterprise Search TLS and cert manager changes Nov 7, 2025
@anandsyncs anandsyncs added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Nov 7, 2025
${test_dir}/test.sh

echo "Sleeping for 120s to let replicaset nodes restarted and configured with the search configuration."
sleep 120
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not help a user running the snippets, should we add this as a real step?

Copy link
Contributor

Choose a reason for hiding this comment

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

Users won't be so quick when running the steps manually. Until we have the search status in MongoDB CR we won't have a good way to wait for the config to finish...

lsierant and others added 2 commits November 7, 2025 11:07
@anandsyncs anandsyncs marked this pull request as ready for review November 7, 2025 12:23
@anandsyncs anandsyncs requested a review from a team as a code owner November 7, 2025 12:23
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the loop over the MDB_MEMBERS variable here like in Community?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants