Percona Everest is the first open source platform designed for automated database provisioning and management. It supports multiple database technologies and can be hosted on any Kubernetes infrastructure, in the cloud or on-premises.
It provides an easy-to-use web interface while leveraging the power of the Percona Operators behind the scenes to do all the heavy lifting. In this post, we will look at how to deploy MongoDB database clusters.
Percona Everest leverages Percona’s Operators for PostgreSQL, MySQL, and MongoDB. At the time of this writing, the latest supported version of the Percona Operator for MongoDB is 1.15.0. This version can deploy Percona Server for MongoDB 4.4, 5.0, and 6.0. Newer versions will become available in the future.
Percona Everest requires a running Kubernetes cluster. See the Percona Everest quick install guide for instructions on how to provision a Kubernetes cluster and then deploy Percona Everest on it.
Deploying MongoDB with Percona Everest
The Percona Everest web interface becomes available on port 8080 after completing the installation procedure. Once authenticated, we are greeted with the home page, which shows the existing database instances:
Let’s provision a new MongoDB database. Start by clicking on the “Create Database” button and select “MongoDB”:
Namespaces provide a mechanism for isolating groups of resources within a single Kubernetes cluster. For example we can separate the different environments (dev, QA, test, prod) and even run different versions of the Operators on each of them.
The storage classes are pre-determined based on your specific Kubernetes cluster configuration.
Clicking on the “Continue” button takes us to the next screen, which allows us to select the number of nodes, as well as their reserved resources:
Percona Everest provides some predetermined configurations, and we can also choose our own settings. At this time, only replica sets are supported. Sharded clusters will become available in the near future.
Next, we get to the “Backups” section. Here, we can configure a backup schedule for our database:
Percona Everest relies on Percona Backup for MongoDB (PBM) to provide the ability to perform backups and point-in-time recovery using the oplog. PBM is an open source solution for consistent backups and restores of MongoDB.
For example, we can set up daily backups as follows:
The next section allows us to enable access to the database from outside Kubernetes, as well as customize the MongoDB configuration:
By default, Percona Everest creates a ClusterIP Service for each provisioned database. This allows access to the database only from within the Kubernetes cluster.
If we need to expose the database for access from outside Kubernetes, add one or more CIDR blocks to the “Source Range” configuration. Percona Everest will create the required network access rules, as well as a LoadBalancer Service for each replica set pod.
This section also allows us to change the MongoDB configuration parameters, such as enabling the profiler. When ready, click the “Continue” button.
The Monitoring section allows us to register the created database with an existing Percona Monitoring and Management (PMM) instance. PMM is an open source database monitoring, management, and observability solution for MySQL, PostgreSQL, and MongoDB.
The PMM instance itself can also be run in Kubernetes. For more information, see the PMM on Kubernetes documentation.
After clicking on the “Create Database” button, we are presented with the following screen:
The process takes only a couple of minutes. We can check the status by going back to the main page:
Connecting to MongoDB
The final step is connecting to our newly created database. We can get the required information by clicking on the name of the database:
Here, we can see the details, including the appropriate connection string and the credentials. For a database created with no external access, the name of the ClusterIP Service is displayed:
We can test the connection by spinning up a pod with the percona-server-mongodb image:
1 |
kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:6.0 --restart=Never -- bash -il |
Now, from inside the pod, we run mongo shell to connect:
1 |
If we choose to enable access from outside Kubernetes, then the LoadBalancer service for each replica set member will be listed (instead of the ClusterIP Service).
We can test the connection in this case by using either of the LoadBalancer endpoints to hit specific nodes:
1 |
Replica Set-style URIs are currently not supported when connecting from outside Kubernetes because the DNS names used on the replica set configuration are not resolvable outside Kubernetes. This is solved by Split-Horizon DNS, which will be introduced in the next Percona Everest release.
What’s next?
This concludes our introduction to running MongoDB on Kubernetes with Percona Everest. As you can see, Percona Everest greatly simplifies the management of MongoDB clusters through automated backups, recovery, and seamless updates, significantly reducing the administrative burden.
Percona Everest offers a streamlined and efficient solution for deploying MongoDB instances on Kubernetes, bringing numerous benefits. By leveraging Kubernetes’ powerful orchestration capabilities, Percona Everest ensures high availability, automated scaling, and self-healing for MongoDB deployments.
Do you have questions? Learn more at https://www.percona.com/software/percona-everest and participate in the Community Forum with your feedback about Percona Everest.