= Installing the Operator  [[dv-install]]
Before you install the Operator for Teiid, make sure you have access to an OpenShift Instance. You may also install a local xref:minishift.adoc[minishift].


== On OpenShift 3.11 [[ocp311]]
If you are working with OpenShift 3.11 then follow the below instructions. Make sure you have access to a OpenShift instance and you have `Cluster Admin` privileges to install the Operator. If you are working with local `minishift` instance then all permissions needed are available in through the `admin` user.

[source,bash]
----
oc login 

export OP_ROOT=https://raw.githubusercontent.com/teiid/teiid-operator/7.5-0.0.x/deploy
oc create -f $OP_ROOT/crds/virtualdatabase.crd.yaml
oc create -f $OP_ROOT/service_account.yaml
oc create -f $OP_ROOT/role.yaml
oc create -f $OP_ROOT/role_binding.yaml
oc create -f $OP_ROOT/operator.yaml
----

or there is script available with above, execute

[source,bash]
----
oc login

./install-operator.sh
----


If there were no errors, you should have a Teiid Operator deployed in your OpenShift instance in the logged in namespace. You can now, use the `VirtualDatabase Deployment` section to create and deploy VDB as image.


== On OpenShift 4.2 or later [[ocp4]]
On the OpenShift 4.2 later the Teiid Operator is available through OperatorHub. Go to the Operator catalog and find and install the `Teiid Operator`

== Operatorions on VDB with Operator

Once the Operator is available on your OpenShift cluster you can deploy a crd yaml file of your VDB.  This document will show deploying and interacting with the customer vdb from the rdbms-example.

[source,bash]
----
cd rdbms-example
oc create -f dv-customer.yaml
----

You can list all the virtualizations available in the OpenShift cluster by executing

[source,bash]
----
oc get vdbs
----

or get a particular one by executing 
[source,bash]
----
oc get vdb dv-customer

# or below to see whole yaml resource for the vdb
oc get vdb dv-customer -o yaml
----

The `status` field in the yaml file defines the status of the virtualization.

To remove a virtualization and all of its resources, use

[source,bash]
----
oc delete vdb dv-customer
----

If you want to make modification to a virtualization, you can do

----
oc edit vdb dv-customer
----
