Skip to content

Conversation

@alaye-ms
Copy link
Collaborator

Allows the adding and removal of regions, as well as test scripts.

Depends on kubefleet change.

@alaye-ms alaye-ms linked an issue Dec 19, 2025 that may be closed by this pull request
Copilot AI review requested due to automatic review settings January 21, 2026 16:47
@alaye-ms alaye-ms force-pushed the addRegionPlayground branch from 042a7a0 to c1e70a0 Compare January 21, 2026 16:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a "region playground" for testing DocumentDB's dynamic region addition and removal capabilities in AKS Fleet environments. It introduces operator support for handling clusters not present in the replication topology and provides comprehensive test scripts for validating multi-region operations.

Changes:

  • Added NotPresent replication state to handle DocumentDB instances excluded from the fleet cluster list
  • Refactored physical replication logic to use asynchronous demotion token handling via goroutines
  • Created playground scripts for adding/removing regions and validating fleet topology changes
  • Simplified Bicep templates by removing hardcoded peering and moving to dynamic generation

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
operator/src/internal/utils/util.go Added DeleteOwnedResources function to clean up Services and CNPG Clusters owned by a DocumentDB instance
operator/src/internal/utils/replication_context.go Introduced NotPresent state for clusters excluded from replication topology
operator/src/internal/utils/constants.go Added new JSON patch path constants for external clusters, managed services, and synchronous configuration
operator/src/internal/controller/physical_replication.go Refactored cluster update logic to separate primary change and replica change operations; moved to async demotion token handling
operator/src/internal/controller/documentdb_controller.go Added early return path when replication context is NotPresent, triggering resource cleanup
documentdb-playground/fleet-add-region/remove-region.sh Script to remove a region from DocumentDB cluster list
documentdb-playground/fleet-add-region/add-region.sh Script to add a region to DocumentDB cluster list
documentdb-playground/fleet-add-region/documentdb-three-region.sh Sets up a three-region DocumentDB configuration
documentdb-playground/fleet-add-region/check.sh Comprehensive validation script for verifying fleet topology and CNPG resources
documentdb-playground/fleet-add-region/deploy-four-region.sh Wrapper script to deploy a four-region fleet
documentdb-playground/fleet-add-region/documentdb-resource-crp.yaml YAML template for DocumentDB multi-region resources
documentdb-playground/fleet-add-region/README.md Documentation for the region playground workflows
documentdb-playground/aks-fleet-deployment/parameters.bicepparam Removed hardcoded parameters file in favor of dynamic parameter passing
documentdb-playground/aks-fleet-deployment/main.bicep Simplified VNet addressing to use index-based ranges and removed hardcoded peering
documentdb-playground/aks-fleet-deployment/install-documentdb-operator.sh Fixed path reference to use SCRIPT_DIR
documentdb-playground/aks-fleet-deployment/documentdb-operator-crp.yaml Removed obsolete backup CRD references
documentdb-playground/aks-fleet-deployment/deploy-multi-region.sh Fixed service naming to include cluster name for uniqueness
documentdb-playground/aks-fleet-deployment/deploy-fleet-bicep.sh Moved VNet peering from Bicep template to dynamic shell script generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alaye-ms alaye-ms force-pushed the addRegionPlayground branch from 4ac2e04 to f1e191b Compare January 22, 2026 20:51
@alaye-ms alaye-ms force-pushed the addRegionPlayground branch from 5df67d4 to b8c1d8a Compare January 27, 2026 21:47
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.

Region-add/remove for multi region/multi cloud

3 participants