Chapter 6. Running the Data Virtualization Operator to deploy a virtual database
The Data Virtualization Operator helps to automate the configuration and deployment of virtual databases.
The Operator processes a virtual database custom resource (CR) to deploy a virtual database object on OpenShift. By running the operator with different CRs, you can create virtual databases from a range of data sources.
Virtual databases that you deploy to OpenShift in this Technology Preview are not available from Fuse Online.
6.1. Installing the Data Virtualization Operator on OpenShift
Install the Data Virtualization Operator so that you can use it to deploy virtual database images to OpenShift from YAML-based custom resources (CRs).
You can install the data virtualization operator from the OperatorHub on OpenShift 4.2 and later.
After you add the operator to your OpenShift cluster, you can use it to build and deploy virtual database images from a range of data sources.
Prerequisites
- You have cluster-admin access to an OpenShift 4.2 or greater cluster.
- You have access to the OpenShift 4.2 or greater web console.
- You have Developer access to an OpenShift server and you are familiar with using the OpenShift console and CLI.
Procedure
From a terminal window, type the following commands to log in to the OpenShift cluster and create a pull secret that you can use to access the Red Hat image registry:
oc login oc create secret docker-registry dv-pull-secret / --docker-server=registry.redhat.io / --docker-username=$username / 1 --docker-password=$password / --docker-email=$email_address oc secrets link builder dv-pull-secret oc secrets link builder dv-pull-secret --for=pull
- 1
- Use your Red Hat Customer Portal login credentials.
- Log in to the OpenShift web console as a cluster administrator.
- From the OpenShift menu, expand Operators and click OperatorHub.
- Click Red Hat Integration - Data Virtualization, and then click Install.
From the Create Operator Subscription page, verify that the selected namespace matches the name of the project where you want to install the operator, and then click Subscribe.
The Installed Operators page lists the Data Virtualization Operator and reports the status of the installation.
- From the OpenShift menu, expand Workloads and click Pods to check the status of the Operator pod. After a few minutes, the pod for the Operator service begins to run.
To enable the data virtualization Operator to retrieve images from the Red Hat registry so that you can create virtual databases, link the secret that you created in Step 1 to the service account for the Operator.
oc secrets link dv-operator dv-pull-secret --for=pull
Additional resources
6.2. Deploying virtual databases
After you create a virtual database and its corresponding CR file, run the Data Virtualization Operator to deploy the database to Openshift.
Prerequisites
- A cluster administrator added the Data Virtualization Operator to the OpenShift cluster where you want to deploy the virtual database.
- You have access to an OpenShift cluster in which the Data Virtualization Operator is installed.
- You have a CR in YAML format that provides information about how to configure and deploy the virtual database.
- The Operator has access to the Maven repositories that contain the dependencies that the build requires.
- OpenShift can access the data source that is referenced in the CR.
Procedure
- From a terminal window, log in to OpenShift and open the project where you want to create the virtual database.
-
On your computer, change to the directory that contains the
.yaml
file that contains the CR. Type the following command to run the operator to create the virtual database:
oc create -f <cr_filename.yaml>
Replace
<cr_filename.yaml>
with the name of the CR file for your data source. For example,oc create -f dv-customer.yaml
After the deployment completes, a virtual database service is added to the OpenShift cluster. The name of the service matches the name that is specified in the custom resource.
Type the following command to verify that the virtual database is created:
oc get vdbs
OpenShift returns the list of virtual databases in the project.
To see whether a particular virtualization is available, type the following command:
oc get vdb <dv-name>
The deployed service supports connections from the following clients:
- JDBC clients through port 31000.
- postgreSQL clients, including ODBC clients, through port 5432.
- OData clients, through an HTTP endpoint and route.