Skip to main content

Kubernetes Broker for MongoDB Atlas Cloud provider

Project description

Atlas Broker for Kubernetes Service Catalog

Code documentation (sphinx)


The docker folder provides everything to create an image that will serve Service Catalog requests in Kubernetes.

Atlasbroker module


This package is available for Python 3.5+.

pip3 install atlasbroker

Or install the development version from github:

pip3 install git+


Examples in this README are using the secret.json file to inject Atlas and Mongo credentials. Of course you can use any other solution provided by your infrastructure.

# Secrets structure
secrets = {
    "mongo" : {
        "uri": "",
        "db": "",
        "timeoutms": 5000,
        "collection" : ""
    "atlas" : {
        "user": "",
        "password" : "",
        "group" : ""

Quick start

from import Broker
from atlasbroker.config import Config

secrets = Config.load_json("secret.json")

config = Config(secrets["atlas"], secrets["mongo"])


Custom Config

The class Config is the main way to customize the broker. All important functions like generate credentials, database name, permissions of the database user, UUID, etc are exposed on this class.

Please read the Code documentation for more details.

from import Broker
from atlasbroker.config import Config

secrets = Config.load_json("secret.json")

class CustomConfig(Config):

    def generate_binding_username(self, binding):
        return binding.binding_id + '-rw'

    def generate_instance_dbname(self, instance):
        return instance.parameters[self.PARAMETER_NAMESPACE]

config = CustomConfig(secrets["atlas"], secrets["mongo"])


Error Types


  • ErrClusterNotFound
    Cluster not found
  • ErrClusterConfig
    Cluster configuration not found
  • ErrStorageMongoConnection
    The storage is not able to communicate with MongoDB
  • ErrStorageTypeUnsupported
    Type unsupported
  • ErrStorageRemoveInstance
    Failed to remove the instance
  • ErrStorageRemoveBinding
    Failed to remove the binding
  • ErrStorageStore
    Failed to store the instance or binding
  • ErrStorageFindInstance
    Failed to find the instance
  • ErrPlanUnsupported
    Plan not supported

Bugs or Issues

Please report bugs, issues or feature requests to Github Issues

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

atlasbroker-2.0.0-py3-none-any.whl (18.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page