Important
Atlas Open Service Broker is deprecated. Use the MongoDB Atlas Operator instead.
You can specify a list of allowed cloud service providers and instance sizes for Atlas clusters deployed with the Atlas Open Service Broker. This whitelist can help control costs or ensure compliance by limiting Atlas clusters to certain cloud providers and sizes. When you apply a whitelist and then deploy a cluster, only the providers and instance sizes listed in the whitelist appear in the Service Catalog marketplace.
Prerequisites
You must have the Atlas Open Service Broker installed.
Considerations
Whitelist Scope
The whitelist applies only to Atlas clusters created through the Atlas Open Service Broker. Atlas clusters created in the same project through the UI are not limited by the whitelist.
Existing Clusters
You can create and apply a whitelist at any time. If you have existing Atlas clusters in your project, make sure that their cloud service providers and instance sizes are included in the whitelist to prevent possible issues with the Atlas Open Service Broker.
Procedure
Create a whitelist JSON file.
The whitelist is a JSON object that contains a key for each
cloud service provider. Each cloud service provider key
takes an array of corresponding instance sizes as its value. To view a
list of available instance sizes, see the
providerSettings.instanceSizeName parameter in the Atlas
Create a Cluster API.
Open your preferred text editor and create a JSON file using the following key-value pairs:
KeyTypeDescriptionTENANTstring array
Array of allowed instance sizes on shared Atlas tenants. Supported values are:
M2M5
Note
The value you specify for the
spec.regionNamesetting when you deploy a cluster determines which cloud provider the cluster is deployed to.AWSstring array
Array of allowed Amazon Web Services instance sizes.
GCPstring array
Array of allowed Google Cloud Platform instance sizes.
AZUREstring array
Array of allowed Microsoft Azure instance sizes.
Example
This example JSON file whitelists the following cloud service providers and instance sizes:
Shared Atlas tenants:
M2andM5Google Cloud Platform:
M10,M20, andM200Amazon Web Services:
M10,M20,M100, andM140Microsoft Azure:
M10,M20, andM200
{ "TENANT": [ "M2", "M5" ], "GCP": [ "M10", "M20", "M200" ], "AWS": [ "M10", "M20", "M100", "M140" ], "AZURE": [ "M10", "M20", "M200" ] } Save this file as
providers-whitelist.json.
Create a ConfigMap object from your JSON file.
You use a configMap resource to add the whitelist data
into your deployment.
Invoke the following command to create a configMap resource named
providers-whitelist from the providers-whitelist.json file:
kubectl create configmap providers-whitelist --from-file=providers-whitelist.json -n <NAMESPACE>
Edit your Deployment resource definition.
Open your
Deploymentresource definition YAML file in your preferred text editor.Tip
If you followed the Installation tutorial, this resource is defined in
deployment-and-service.yaml.Copy the highlighted parameters and paste them into to the
kind: Deploymentresource definition.These parameters direct Kubernetes to mount the ConfigMap to this deployment as a volume at the specified path.
spec: template: spec: containers: - name: atlas-service-broker image: quay.io/mongodb/mongodb-atlas-service-broker:latest ports: - containerPort: 4000 env: - name: BROKER_HOST value: 0.0.0.0 - name: PROVIDERS_WHITELIST_FILE value: <PATH_TO_WHITELIST_FILE> volumeMounts: - name: <VOLUME_NAME> mountPath: <PATH_TO_MOUNT_VOLUME> volumes: - name: <VOLUME_NAME> configMap: name: <CONFIGMAP_NAME> Configure the required settings.
KeyDescriptionExamplespec.template.spec.containers.env.valueAbsolute path to the whitelist JSON file.
/etc/config/providers-whitelist.jsonspec.template.spec.containers.volumeMounts.nameName of the volume that contains the whitelist data.This value must matchspec.template.spec.volumes.name.config-volumespec.template.spec.containers.mountPath.valueAbsolute path to mount the volume to in this deployment.
/etc/configspec.template.spec.volumes.nameName of the volume that contains the whitelist data.This value must matchspec.template.spec.containers.volumeMounts.name.config-volumespec.template.spec.volumes.configMap.nameName of the
configMapthat corresponds to the whitelist.providers-whitelistSave the
Deploymentresource definition.
Redeploy the Atlas Open Service Broker.
Invoke the following kubectl command:
kubectl apply -f <DEPLOYMENT_RESOURCE_DEFINITION>.yaml -n <NAMESPACE>