Charmed MongoDB K8 Tutorial | Deploy a sharded cluster

A complete, detailed tutorial about deploying and operating a sharded cluster on MongoDB K8s is currently under construction. Thank you for your patience!

In the meantime, you can:


Deploy a sharded cluster

Here are all the steps you need to learn how to deploy and operate a sharded cluster on MongoDB K8s, including setting up and tearing down a test environment.

1. Set up your environment

See: Tutorial > Deploy a replica set > 1. Set up your environment

The environment setup process (Juju, MicroK8s) is independent of the deployment type (replica set or sharded cluster).

2. Deploy MongoDB

See: How to > Deploy MongoDB > Create a MongoDB sharded cluster

3. Access a sharded cluster

To deploy, integrate, and retrieve the URI, see: Mongos K8s documentation > Get started (external page)

To access the mongo shell and create a test database, see Tutorial > Deploy a replica set > 3. Access a replica set

Keep in mind that for a sharded cluster, you must ssh into the config-server unit instead of mongodb-k8s.

4. Add and remove shards

See: How to > Scale replicas and shards > Scale a sharded cluster

5. Manage passwords

See: How to > Manage client connections > Rotate mongos password

6. Integrate with other applications

See: How to > Manage client connections > Create a client connection to a sharded cluster

7. Enable TLS

See: How to > Enable TLS encryption > Enable and disable TLS in a sharded cluster

8. Clean up your environment

See: Tutorial > Deploy a replica set > 8. Clean up your environment

The environment cleanup process is independent of the deployment type (replica set or sharded cluster).