MongoDB Kubernetes operator is ready for prime-time. Learn about how MongoDB can be used with most popular orchestration platform, Kubernetes, and bring self-service, persistent storage to your containerized applications.
7. #MDBLocal
Kubernetes Service Catalog
It’s Really this easy….
1. Craft resources that define
your application
2. Define the MongoDB Atlas
persistence service it
relies on
3. Seamlessly Connect the
two
The elegance of simplicity
9. #MDBLocal
The service catalog translates CRD into requests to the Atlas Service
Broker, Provisions resources on your behalf, and injects the
credentials for access back into your containers
Kubernetes Service catalog
Easy Mode
11. #MDBLocal
MongoDB Kubernetes Architectural Alternatives
Hybrid Cloud or Cloud
● MongoDb Open
Service Broker
Best Practice -- depends on requirements
On-Premise - Air gapped
● MongoDB Kubernetes
Operator
● Hybrid Cloud
13. #MDBLocal
MongoDB Open Service Broker or MongoDB Operator
Considerations
● Is there time/budget for maintenance tasks, like backups, patching and
scaling (up and down)
● Pods are transient, so the likelihood of database application restarts or
failovers is higher
● Databases that are storing more transient and caching layers are better fits
for Kubernetes
● MongoDB Operator uses the Kubernetes StatefulSet. Your data can be stored
on persistent volumes, decoupling the database application from the
persistent storage, so when a pod (MongoDB application) is recreated, all the
data is still there
Containerization Data layer -- finally getting traction
19. #MDBLocal
---
# Service to expose the service broker inside the cluster.
apiVersion: v1
kind: Service
metadata:
name: atlas-service-broker
labels:
app: atlas-service-broker
spec:
selector:
# Will match pods deployed by the "atlas-service-broker" deployment.
app: atlas-service-broker
ports:
- protocol: TCP
port: 80
targetPort: 4000
20. #MDBLocal
Atlas API Key (for Kubernetes Secret)
Key Values
● Public Key - Visible
● Private Key -- partial
obfuscated
● username:
○ public Key@Org ID
● password:
○ private Key
Atlas UI
stringData:
username: fdeadoen@5d656831c56c98173cf5dead
password: d7ef8f25-ac31-dead-9723-93463d39dead
21. #MDBLocal
Project Id (for Kubernetes Secret)
Key Values
● Public Key - Visible
● Private Key -- partial
obfuscated
● username:
○ public Key@Project ID
● password:
○ private Key
Atlas UI
stringData:
username: fdeadoen@5d656831c56c98173cf5dead
password: d7ef8f25-ac31-dead-9723-93463d39dead
23. #MDBLocal
#! /usr/bin/env bash
#
# Register the Atlas Open Service Broker with the Kubernetes Service Catalog
#
kubectl apply -f service-broker.yaml -n atlas
svcat get brokers -n atlas
##
# Check our Work
##
svcat describe broker atlas-service-broker -n atlas
# Deploy ReplicaSet
#
kubectl apply -f replica-set.yaml
# How is the deployment going
svcat describe instance my-atlas-cluster -n atlas
24. #MDBLocal
Service Options
ClusterServiceBroker
● An Atlas Open Service Broker instance that is registered as a ClusterServiceBroker is available to the
entire Kubernetes cluster. When you deploy a Atlas replica set or sharded cluster, you must use the
associated clusterServiceClass and clusterServicePlan resources.
ServiceBroker
● An Atlas Open Service Broker instance that is registered as a ServiceBroker is available to only a single
namespace within the Kubernetes cluster. When you deploy a Atlas replica set or sharded cluster, you
must use the serviceClass and servicePlan resources scoped to the same namespace.