Skip to content

Docs/search external replicaset external lb#788

Closed
anandsyncs wants to merge 8 commits intofeature/external-sharded-mongodb-sourcefrom
docs/search-external-replicaset-external-lb
Closed

Docs/search external replicaset external lb#788
anandsyncs wants to merge 8 commits intofeature/external-sharded-mongodb-sourcefrom
docs/search-external-replicaset-external-lb

Conversation

@anandsyncs
Copy link
Contributor

Summary

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?

- TestIsSharedTLSCertificate: Tests shared vs per-shard TLS mode detection
- TestTLSSecretNamespacedNameForShard: Tests per-shard source secret naming
- TestTLSOperatorSecretNamespacedNameForShard: Tests per-shard operator secret naming
- TestPerShardTLSResourceAdapter: Tests the perShardTLSResource adapter struct
- TestValidatePerShardTLSSecrets: Tests validation of per-shard TLS secrets
- TestValidatePerShardTLSSecretsAllExist: Integration test for multiple shards
- env_variables.sh: Add MDB_SEARCH_TLS_CERT_PREFIX for per-shard TLS naming
- 05_0304_generate_tls_certificates.sh: Generate per-shard certificates
  instead of one shared certificate (pattern: {prefix}-{shardName}-search-cert)
- 05_0320_create_mongodb_search_resource.sh: Use certsSecretPrefix and
  endpoint template with {shardName} placeholder instead of legacy format
- 05_0340_verify_mongod_search_config.sh: Add per-shard TLS secret verification
- test.sh: Enable verification script execution
Changes to YAML fixture (search-sharded-external-lb.yaml):
- Replace certificateKeySecretRef.name with certsSecretPrefix: certs
- Replace sharded.endpoints array with endpoint template using {shardName}

Changes to Python test (search_sharded_enterprise_external_lb.py):
- Replace MDBS_TLS_SECRET_NAME with MDBS_TLS_CERT_PREFIX
- Add read_secret import for TLS verification
- Add create_per_shard_search_tls_certs() helper function
- Update test_009 to create per-shard TLS certificates
- Simplify mdbs fixture to handle endpoint template
- Add test_010a_verify_per_shard_tls_secrets verification test

Secret naming patterns:
- Source secrets: {prefix}-{shardName}-search-cert (e.g., certs-mdb-sh-0-search-cert)
- Operator secrets: {shardName}-search-certificate-key (e.g., mdb-sh-0-search-certificate-key)
The endpoint template field should be at spec.lb.external.endpoint,
not spec.lb.external.sharded.endpoint.

The CRD schema defines:
- spec.lb.external.endpoint: Template endpoint (for {shardName} placeholder)
- spec.lb.external.sharded.endpoints: Legacy array format (deprecated)

The sharded object only has 'endpoints' (array), not 'endpoint' (string).
When sharded object exists without the required endpoints array,
Kubernetes validation fails with 'spec.lb.external.sharded.endpoints: Required value'.

Changes:
- YAML fixture: Move endpoint from sharded block to external level
- Python fixture: Update path to replace NAMESPACE placeholder
The operator creates TLS secrets with hash-based filenames (SHA256 hash + .pem)
not a literal 'certificate-key' key. Updated test_010a_verify_per_shard_tls_secrets
to check for keys ending in .pem instead of looking for 'certificate-key'.
…ppets

This merge brings in:
- Per-shard TLS certificate support with CertsSecretPrefix field
- IsSharedTLSCertificate(), TLSSecretNamespacedNameForShard() methods
- perShardTLSResource adapter for per-shard TLS processing
- validatePerShardTLSSecrets() and ensureIngressTlsConfigForShard() functions
- Updated e2e tests with .pem key verification
- Endpoint template with {shardName} placeholder support

Conflict resolution:
- search-sharded-external-lb.yaml: Used endpoint template format with {shardName}
  placeholder instead of the deprecated sharded.endpoints array format
…nal replica set and external LB

This documentation provides step-by-step instructions for Technical Services
to test MongoDB Search with:
- External non-sharded replica set (3 members) as data source
- Multiple mongot replicas (2-3) for high availability
- Envoy proxy as L7 load balancer with round-robin distribution
- TLS enabled for all connections (mongod → Envoy → mongot)
- External LB mode configuration in MongoDBSearch

Includes:
- Architecture overview and traffic flow diagrams
- Environment variables configuration
- 17 step-by-step instructions with expected outputs
- Verification steps for all components
- Troubleshooting guide for common issues
- Cleanup instructions

Location: docs/search/07-search-external-replicaset-external-lb/README.md
@anandsyncs anandsyncs changed the base branch from master to search/sharded-lb-external-sharded February 15, 2026 09:27
@anandsyncs anandsyncs changed the base branch from search/sharded-lb-external-sharded to feature/external-sharded-mongodb-source February 15, 2026 09:28
@github-actions
Copy link

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

MCK 1.7.1 Release Notes

Other Changes

  • Container images: Merged the init-database and init-appdb init container images into a single init-database image. The init-appdb image will no longer be published and does not affect existing deployments.

@lsierant
Copy link
Contributor

incorporated into #787

@lsierant lsierant closed this Feb 16, 2026
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.

2 participants