Skip to content

Conversation

@fealebenpae
Copy link
Contributor

@fealebenpae fealebenpae commented Oct 13, 2025

Summary

This updates the mongod->mongot communication to use the gRPC protocol as the Wire Protocol server is deprecated in mongot.

Proof of Work

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?

@fealebenpae fealebenpae self-assigned this Oct 13, 2025
@github-actions
Copy link

github-actions bot commented Oct 13, 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.

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

  • 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

@fealebenpae fealebenpae force-pushed the fealebenpae/search-grpc branch from 5cc67a1 to 3ec055e Compare October 13, 2025 13:09

serviceBuilder.AddPort(&corev1.ServicePort{
Name: "mongot",
Name: "mongot-wireproto",
Copy link
Contributor

Choose a reason for hiding this comment

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

could we add service port only if we force wireproto?



@mark.e2e_search_community_tls
def test_validate_tls_connections(mdbc: MongoDBCommunity, mdbs: MongoDBSearch, namespace: str, issuer_ca_filepath: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't attempt to validate connections here anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't able to find a simple way to call the gRPC service in mongot from Python that didn't involve a lot of boilerplate, so I opted to remove this altogether.

DataPath: searchcontroller.MongotDataPath,
},
Server: mongot.ConfigServer{
Wireproto: &mongot.ConfigWireproto{
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we still keep a wireproto test as long as it is possible to enabled it?

}

r.watch.AddWatchedResourceIfNotAdded(searchSource.KeyfileSecretName(), mdbSearch.Namespace, watch.Secret, mdbSearch.NamespacedName())
if mdbSearch.IsWireprotoForced() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of all these if statements, would it make sense to abstract the wireproto stuff away in a struct and then it's also easier to just remove it.

"searchIndexManagementHostAndPort": mongotHostAndPort(search),
"skipAuthenticationToSearchIndexManagementServer": false,
"searchTLSMode": string(searchTLSMode),
"useGrpcForSearch": !search.IsWireprotoForced(),
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the meaning of this, don't we always enable this by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The server doesn't enable useGrpcForSearch by default, no. We enable it only when the force-wireproto annotation is not set, but in essenceuseGrpcForSearch will be turned on by default, unless the annotation requests otherwise.

@fealebenpae fealebenpae changed the title [Search] Implement gRPC and mTLS CLOUDP-353160 [Search] Implement gRPC and mTLS Oct 30, 2025
@fealebenpae fealebenpae force-pushed the fealebenpae/search-grpc branch from ef87f24 to fc149a0 Compare October 30, 2025 13:40
@fealebenpae fealebenpae force-pushed the fealebenpae/search-grpc branch from fc149a0 to cb83dbc Compare October 30, 2025 13:42
@fealebenpae fealebenpae marked this pull request as ready for review October 30, 2025 13:58
@fealebenpae fealebenpae requested a review from vinilage as a code owner October 30, 2025 13:58
@fealebenpae fealebenpae requested a review from a team as a code owner October 30, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants