OpenShift Database Access Operator (a.k.a. DBaaS Operator) is currently iterating early releases. The intent of these releases is to show how we could create trail database cluster, scan & import off-cluster cloud database instances hosted by various 3rd party ISV providers & make those instances available to developers for binding to their applications.
Component | Git Repo | Description |
---|---|---|
DBaaS Console Plugin | DBaaS Dynamic Plugin | DBaaS UI console plugin, creation for “Provider Account” and a bindable “Connection” resource. |
Crunchy Bridge Operator | Crunchy Bridge PostgreSQL | Operator responsible for establishing API communications with Crunchy Bridge Managed Postgres Database. |
CockroachCloud Operator | CockroachCloud Operator | Operator responsible for establishing API communications with CockroachCloud Provider Platform. |
Service Binding Operator | Service Binding Operator | Red Hat operator for binding resources together via Topology View. |
RDS Operator | RDS Operator | Operator for Amazon RDS building on top of ACK (AWS Controller for Kubernetes). |
Observability Operator | Observability Operator | Operator for installing the monitoring stack and configuring remote write Observatorium. |
Requires:
- go v1.18
- operator-sdk v1.22.2
Build the OpenShift Database Access Operator image and its bundle and catalog images and push them to a public registry, such as quay.io:
ORG=<YOUR_QUAY_USER> VERSION=<version> make release-build release-push
If you are using podman instead of docker:
CONTAINER_ENGINE=podman ORG=<YOUR_QUAY_USER> VERSION=<version> make release-build release-push
You can also build and push the image to a public registry other than quay.io:
-
REGISTRY=<YOUR_REGISTRY> VERSION=<version> make release-build release-push
-
Make visibility of the repositories (
dbaas-operator
,dbaas-operator-bundle
, anddbaas-operator-catalog
) public in your Quay.io account -
ORG=<YOUR_QUAY_USER> VERSION=<version> make catalog-update
- Note: We already pre-build the dbaas-operator images, which can be deployed to the cluster. They can be found here: https://quay.io/repository/ecosystem-appeng/dbaas-operator-dev-catalog?tab=tags
- You can also find the exact commit you want to deploy based on the commit sha.
NOTE: The DBaaS console UI portion of the workflow described below will only work if your operator is installed via OLM and using version OpenShift Container Platform (OCP) version 4.10 or higher. If you run locally or via direct deploy (no longer recommended), you can create a DBaaSInventory. DBaaSConnection CRs created directly in command line can appear in the topology view in the OpenShift Console.
Install the Operator From OperatorHub:
- Access to an OpenShift and navigate in the web console to the Operators → OperatorHub page.
- Scroll or type a keyword into the Filter by keyword box OpenShift Database Access Operator click Install. The DBaaS operator is cluster scope and the default installed namespace is openshift-dbaas-operator.
- On successful installation of DBaaS operator, will automatically install all its dependencies and the operator logs shows: DBaaS platform stack installation complete.
- Continue below by following the Using the Operator section
- If you wish to uninstall operator click Operators →Installed Operators then OpenShift Database Access Operator click Uninstall Operator from Actions
Prerequisites:
- Either OpenShift Container Platform or Origin Kubernetes Distribution (OKD) 4.10 or higher.
- Installation of the OpenShift Database Access operator.
- A service account with either the Crunchy Data Bridge, or CockroachDB, or Amazon RDS cloud-hosted database provider.
Creating a DBaaSInventory:
-
From the OpenShift console home page, in the Administrator perspective, click Data Services(the last menu option), then click Database Access.
-
Click the Configure button to view the dropdown links.
-
Click the Import Database Provider Account link to create a new provider account. NOTE: Refresh the page if you are not seeing the DBaaS Console UI, this requires a one-time only plugin reload.
-
On the Import Provider Account page, select a Database provider, provide the credentials for your choosen cloud-hosted database provider, and specify a name for the new provider account resource.
-
Click the Import button to create the provider account resource, and fetch the available database instances.
-
If fetching is successful, then you see can the exposed database instances that developers can import, or you can click the View Provider Accounts button to return to the provider account's DBaaSInventorys page. Click the link to view an IT Operations preview demo of OpenShift Database Access.
Creating a DBaaSConnection:
- From the OpenShift console home page, switch to the Developer perspective.
- Click +Add.
- Select or create a project for your application where you want to add a database to. Here is sample application deployment for Service Bindings.
- Click the Cloud-hosted Database category.
- Select the cloud-hosted database provider tile, and click Add to Topology.
- Select the database instance name, and click Add to Topology.
- Upon a successful connection, you are taken to the Topology page.
- Click and drag the arrow from the application to the new database instance to create a binding connector. Click the link to view a Developer preview demo of OpenShift Database Access.
Creating a DBaaSInstance:
Users can provision a new database cluster (or instance) by creating a DBaaSInstance custom resource through the Administrator or Developer perspective with the following steps.
Administrator Perspective
- Click the Database Services-->Database Access to view the DBaaS Dashboard page.
- From the top corner click Configure then Create Database Instance link.
- Select the desired Database Provider type and Provider account.
- Choose the name, cloud provider, other configuration options.
- Click the Create button to create the DBaaSInstance.
Developer Perspective
- From the OpenShift console home page, switch to the Developer perspective.
- Click +Add.
- Click the Cloud-hosted Database category.
- Select the cloud-hosted database provider tile, and click Add to Topology.
- Click on the Creat New Database Instance
- This will redirect to Create Database Instance Page
- Choose the name, cloud provider, other configuration options.
- Click the Create button to create the DBaaSInstance.
- Fork OpenShift Database Access Operator repository
- Check out code from your new fork
git clone [email protected]:<your-user-name>/dbaas-operator.git
cd dbaas-operator
- Add upstream as git remote entry
git remote add upstream [email protected]:RHEcosystemAppEng/dbaas-operator.git
- create feature branches within your fork to complete your work
- raise PR's from your feature branch targeting upstream main branch
- If the go installation version on your dev machine is different from the one required e.g. go1.18, visit the go.dev/dl
- Download the installer package for the needed version e.g. go1.18.x and follow official go installation instructions
- Verify the go installation is successful
make install run INSTALL_NAMESPACE=<your_target_namespace> ENABLE_WEBHOOKS=false
- Continue below by following the Using the Operator section
- When finished, remove created resources via:
make clean-namespace
oc project <your_target_namespace>
make deploy
- Continue below by following the Using the Operator section
- When finished, clean up & remove deployment via:
make clean-namespace undeploy