Menu Close
Quick Start Guide
Service Preview Release
Abstract
Preface
The Red Hat OpenShift Database Access is a Service Preview release add-on that enables:
- Easy consumption of database-as-a-service (DBaaS) offerings from partners including MongoDB Atlas, Crunchy Bridge, and CockroachDB directly from managed OpenShift clusters.
- Easy management, monitoring and control by administrators of cloud-hosted DBaaS including consumption, usage, and status.
Red Hat OpenShift Database Access (OpenShift Database Access) is a Service Preview release. A Service Preview release contains features that are early in development. Service Preview releases are not production ready and might have features and functionality that are not fully tested. You are advised not to use OpenShift Database Access for production or business-critical workloads.
To provide feedback or inform our engineering team of any technical issues with OpenShift Database Access, please use dbaas-alpha-support@redhat.com.
Chapter 1. Installing the Red Hat OpenShift Database Access add-on
The Red Hat OpenShift Database Access add-on allows you to configure a connection to cloud-database providers, create new database instances, and connect database instances to applications for developers to use.
Procedure
Log into the Red Hat Hybrid Cloud Console with your credentials.
Click OpenShift from the navigation menu.
- Click Clusters to display a list of your clusters. Select a cluster name from the list to add database access to.
Click Add-ons, and select the Red Hat OpenShift Database Access tile.
Click Install.
Wait for the installation process to finish. Once the add-on installation completes successfully, a green checkmark appears on the tile.
Chapter 2. Accessing the database access menu for configuring and monitoring
You can access the Red Hat OpenShift Database Access page from the OpenShift console navigation menu to select the correct project namespace for importing a cloud-database provider account.
If using MongoDB Atlas as a cloud-database provider, then you must add the IP address of the application pod to MongoDB Atlas' IP Access List. If the IP address is not in the IP Access List, then a 504 gateway timeout error
occurs. Visit the MongoDB Atlas website for more details on adding an IP address to your database project.
Prerequisites
- A service account with either the MongoDB Atlas, or Crunchy Data Bridge, or CockroachDB cloud database provider.
Procedure
- Log into the OpenShift console.
To select the correct project namespace follow these sub-steps.
-
Select the Administrator perspective
.
Expand the Data Services navigation menu, and click Database Access
.
NoteYou might need to scroll down the navigation menu.
-
Click the Project dropdown menu and then enable the Show default projects switch
.
- Type dbaas in the search field.
Select redhat-dbaas-operator or openshift-dbaas-operator project namespace
.
From the database inventory page you can monitor the database environment, import cloud-hosted database provider accounts, or create new database instances.
-
Select the Administrator perspective
Chapter 3. Accessing the developer workspace and adding a database instance
You can access the developer workspace in the OpenShift console to manage connectivity between database instances and applications.
Prerequisites
- Installation of the OpenShift Database Access add-on.
- Import at least one cloud-database provider account.
Procedure
- Log into the OpenShift console.
Access the developer workspace, and select or create your project, then select a cloud-hosted database provider to add to your project:
-
Select the Developer perspective
.
-
Click +Add
.
-
Click the Project dropdown menu
.
-
Create a new project or search for your application’s project
.
-
Select the Cloud-Hosted Databases tile to connect to a cloud-database provider
.
-
Select the Developer perspective
- Select your cloud-hosted database provider tile.
- Click Add to Topology.
- Select a previously configured Provider Account for this database instance from the dropdown menu.
- Select the database instance ID you want to use, and then click Add to Topology.
- Click Continue. Upon a successful connection, you are taken to the Topology page.
Chapter 4. Connecting an application to a database instance using the topology view
You can add a database to an application by making a connection to the database instance from the cloud-database provider. On the Topology page, you see the application, along with the new database instance.
Procedure
Click and drag the arrow from the application to the new database instance to create a binding connector.
On the pop-up dialog, click Create. Once the binding is created, the application pod restarts. After the application pod restarts, your application now has database connectivity.
This binding visually represents the injection of database connection information and credentials into the application pod.
- Use a service binding library based on your application’s framework to consume the service binding information and credentials.
Additional Resources
- See Appendix E, Service binding libraries for more details on service bindings, and working application examples using service binding libraries.
Appendix A. Find your MongoDB Atlas account credentials
You need the Organization ID, the Organization Public Key, and the Organization Private Key to create a provider account resource for MongoDB Atlas.
If using MongoDB Atlas as a cloud-database provider, then you must add the IP address of the application pod to MongoDB Atlas' IP Access List. If the IP address is not in the IP Access List, then a 504 gateway timeout error occurs. Visit the MongoDB Atlas website for more details on adding an IP address to your database project.
Procedure
- From the MongoDB Atlas home page, Sign In to your account.
From your account home page:
-
Select Organization from the dropdown menu
.
-
Click Settings from the Organization navigation menu
.
Copy the Organization ID value
.
NoteIn some cases your organization ID may be hidden by default.
-
Select Organization from the dropdown menu
Next, from the account home page:
-
Click Access Manager from the Organization navigation menu
.
-
Click API Keys
.
-
If you have existing API keys, you can find them listed here. Copy the API public and private keys for the import provider account fields. Also, verify that your API keys have the Organization Owner and Organization Member permissions
.
-
Click Access Manager from the Organization navigation menu
- If you need new API keys, click Create API Key, and proceed to the next step.
- On the Create API Key page, enter a Description, and under the Organization Permissions dropdown box select the Organization Owner and Organization Member permissions. Click Next.
- Copy the API public and private keys for the import provider account fields.
Appendix B. Find your Crunchy Data Bridge account credentials
You need the Public API Key, and the Private API Secret to create a provider account resource for Crunchy Data Bridge.
Procedure
- From the Crunch Data Bridge Log in page, sign in to your account.
From your personal account home page, click Settings, and then click Settings from the navigation menu.
Copy the Application ID and Application Secret values for the import provider account fields.
Appendix C. Find your CockroachDB account credentials
You need the API Key to create a provider account resource for CockroachDB.
Currently, access to the Service Accounts tab on the Access Management page is enabled by invite only from CockroachDB. To expose the Service Accounts tab on the Access Management page, you can request that this feature be enabled. Contact CockroachDB support and ask for the Cloud API to be enabled in the CockroachDB Cloud Console for your user account.
Additionally, you can view this quick video tutorial from Cockroach Labs on creating an account.
Procedure
- From the CockroachDB service account page, log in to your account.
- From your service account home page, select Access from the navigation menu.
- Click Service Accounts from the Access Management page.
- Click Create Service Account.
Enter an Account name, select the Permissions, and click Create.
Enter an API key name, and click Create.
Copy the Secret key for the import provider account field, and click Done.
Appendix D. Deleting a database provider account
Instead of directly editing your cloud-hosted database provider account information, Red Hat recommends you delete the provider account, and recreate a new one.
Procedure
- Log into the OpenShift console.
- Select the Administrator perspective from the navigation menu.
- Expand the Operators navigation menu, and click Installed Operators.
- Click OpenShift Database Access Operator from the list of installed operators.
- Select Provider Account.
- Click the vertical ellipsis for the database provider account you want to delete, and click on Delete DBaaSInventory.
- A dialog box appears to confirm the deletion, click Delete.
- After deleting the database provider account, you can recreate the database provider account by clicking Create DBaaSInventory.
Appendix E. Service binding libraries
The Kubernetes service binding feature was introduced to bring consistency to the way secrets are shared for connecting applications to external services, such as REST APIs, databases, and many other services. OpenShift Database Access leverages the service binding feature to bring a low-touch administrative experience to provisioning, and managing access to external database services. The service binding feature enables developers to connect their applications to database services with a consistent, and predictable experience. Specifically, a service binding creates a volume on the application pod, and organizes the information to make a connection to the database in a directory structure. The volume mount point is exposed as an environment variable. Developer frameworks, such as Quarkus, are service binding aware, and can automatically connect to a database using this exposed workload information without needing to embed database connection information in the application source code.
Here are some application examples on how to use a service binding library:
Additional resources
- See the Kubernetes GitHub project for more details on service bindings.