The databases that KubeDB support are MongoDB, Elasticsearch, MySQL, MariaDB, PostgreSQL and Redis. You can find the guides to all the supported datab

Manage MongoDB in Openshift Using KubeDB

submited by
Style Pass
2021-06-15 05:00:08

The databases that KubeDB support are MongoDB, Elasticsearch, MySQL, MariaDB, PostgreSQL and Redis. You can find the guides to all the supported databases here. In this tutorial we will deploy MongoDB database. We will cover the following steps:

Now we are going to Install MongoDB with the help of KubeDB. At first, let’s create a Namespace in which we will deploy the database.

Here, we can see that I have a storageclass named local-path. If you do not have a storage class you can run the following command:

OpenShift has Security Context Constraints for which the MongoDB CRD is restricted to be deployed. The above command will give the required permissions.
Now, let’s have a look into the yaml of the MongoDB CRD we are going to use:

We have successfully deployed MongoDB in OpenShift. Now we can exec into the container to use the database. Please note that KubeDB operator has created a new Secret called mgo-quickstart-auth for storing the password for mongodb superuser. This secret contains a username key which contains the username for MongoDB superuser and a password key which contains the password for MongoDB superuser.

Leave a Comment