mongos-k8s

  • Canonical Data Platform
Channel Revision Published Runs on
6/edge 15 16 Oct 2024
Ubuntu 22.04
juju deploy mongos-k8s --channel 6/edge
Show information

Platform:

Charmed Mongos K8s documentation

The Charmed Mongos K8s operator deploys and operates mongos instances on Kubernetes.

mongos is a router for connecting client applications to a sharded MongoDB clusters. It is the only way to access a sharded MongoDB cluster from the client perspective.

Summary


Get started

The following steps will guide you through briefly creating a client connection to a sharded MongoDB cluster via mongos-k8s.

You’ll need a Juju environment and a MongoDB K8s application deployed as a sharded cluster. For more guidance, see the Charmed MongoDB K8s deployment guide.

Deploy and integrate

To deploy Mongos K8s and Data Integrator, run:

juju deploy mongos-k8s
juju deploy data-integrator --config database-name=<name>

When the status of the mongos-k8s application becomes idle, integrate mongos-k8s with data-integrator and with the mongodb-k8s application running as config-server:

juju integrate mongos-k8s data-integrator
juju integrate config-server mongos-k8s

Retrieve the URI

In order to access the integrated database, you will need the mongos-k8s URI. To retrieve this, run the following command:

juju run data-integrator/leader get-credentials

You will find the URI under the field uris in the output.

For more information about accessing the database, see the Charmed MongoDB documentation for accessing a client database.

Enable TLS encryption

If the sharded MongoDB cluster has TLS enabled, mongos-k8s must also enable TLS. Enable it by integrating mongos-k8s with a TLS application:

juju integrate mongos-k8s <tls-application>

<tls-application must be the same TLS application that the sharded MongoDB cluster is integrated to.

For more information about TLS in sharded clusters, see the Charmed MongoDB documentation for enabling security in sharded clusters

Remove the connection

To remove a mongos-k8s connection to the sharded cluster, run:

juju remove-relation config-server mongos-k8s

Whenmongos-k8s is removed from the sharded cluster, the client is removed as well.

Learn more

Project and community

Charmed Mongos K8s is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback.

License

The Charmed Mongos Operator is free software, distributed under the Apache Software License, version 2.0. It installs, operates, and depends on MongoDB Community Version, which is licensed under the Server Side Public License (SSPL)

MongoDB is a trademark or registered trademark of MongoDB, Inc. Other trademarks are property of their respective owners.