Skip to content

patch(DPE-9341) mongo db juju spaces support implement juju spaces support#244

Merged
Gu1nness merged 36 commits into8/edgefrom
DPE-9341-mongo-db-juju-spaces-support-implement-juju-spaces-support
Mar 31, 2026
Merged

patch(DPE-9341) mongo db juju spaces support implement juju spaces support#244
Gu1nness merged 36 commits into8/edgefrom
DPE-9341-mongo-db-juju-spaces-support-implement-juju-spaces-support

Conversation

@Gu1nness
Copy link
Copy Markdown
Contributor

🏷️ Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling and CI
  • Dependencies upgrade or change
  • Chores / refactoring

📝 Description

This PR implements support for juju spaces according to DA243.

It contains:

  • Restriction of the IPs the server listens on to specific interfaces
  • Restriction of the CIDRS that can be part of the cluster
  • Restriction of the IPs shared to clients to the specific interfaces
  • User authenticationRestriction in non sharded mode (not possible on sharded mode for a variety of reasons.

🧪 Manual testing steps

1. sudo lxc network create peers --type=bridge ipv4.address="10.137.180.1/24" ipv4.nat=True ipv6.address=none dns.mode=none
2. sudo lxc network create clients --type=bridge ipv4.address="10.137.181.1/24" ipv4.nat=True ipv6.address=none dns.mode=none
3. sudo lxc network set clients raw.dnsmasq "dhcp-option=3
dhcp-option=6"
4. sudo lxc network set peers raw.dnsmasq "dhcp-option=3
dhcp-option=6"
5. juju reload-spaces
6. juju add-space clients 10.137.181.1/24
7. juju add-space peers 10.137.180.1/24
8. juju deploy ./tests/charms/mongodb_test_charm/mongodb_ubuntu@24.04-amd64.charm --constraints spaces=peers,clients --bind "alpha database-peers=peers database=clients" -n3
9. juju deploy ./tests/integration/applications/client_relations_charm/application_ubuntu@24.04-amd64.charm --bind "alpha first-database=clients"
10. juju integrate mongodb application:first-database
11. The URI should contain IPs in the slash 10.137.181.1/24

🔬 Automated testing steps

TBD

✅ Checklist

  • My code follows the code style of this project.
  • I have added or updated any relevant documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Gu1nness Gu1nness changed the title Dpe 9341 mongo db juju spaces support implement juju spaces support patch(DPE-9341) mongo db juju spaces support implement juju spaces support Feb 20, 2026
@Gu1nness Gu1nness marked this pull request as ready for review February 26, 2026 13:32
Comment thread single_kernel_mongo/utils/network_helpers.py
Comment thread tests/unit/test_sharding.py Outdated
Comment thread tests/integration/applications/continuous_write_charm/src/continuous_writes.py Outdated
Comment thread tests/unit/test_helpers.py
Comment thread single_kernel_mongo/state/unit_peer_state.py Outdated
Gu1nness and others added 4 commits February 27, 2026 15:07
Co-authored-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Neha Oudin <17551419+Gu1nness@users.noreply.github.com>
Co-authored-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Neha Oudin <17551419+Gu1nness@users.noreply.github.com>
…uju-spaces-support-implement-juju-spaces-support
Comment thread single_kernel_mongo/managers/mongo.py Outdated
Comment thread single_kernel_mongo/state/charm_state.py Outdated
Comment thread single_kernel_mongo/utils/mongo_connection.py
Comment thread single_kernel_mongo/utils/mongo_config.py Outdated
Comment thread single_kernel_mongo/state/unit_peer_state.py
Comment thread single_kernel_mongo/state/charm_state.py
Comment thread single_kernel_mongo/state/charm_state.py
Copy link
Copy Markdown
Contributor

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

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

Thanks Neha! Great work! I only have questions, mainly on the localhost part

Comment thread single_kernel_mongo/managers/config.py Outdated
Comment thread single_kernel_mongo/state/charm_state.py
Comment thread single_kernel_mongo/managers/config.py Outdated
Comment thread single_kernel_mongo/state/charm_state.py
@Gu1nness Gu1nness requested a review from Mehdi-Bendriss March 19, 2026 11:10
@Gu1nness Gu1nness merged commit 0847649 into 8/edge Mar 31, 2026
323 of 370 checks passed
@Gu1nness Gu1nness deleted the DPE-9341-mongo-db-juju-spaces-support-implement-juju-spaces-support branch March 31, 2026 14:25
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.

3 participants