Generating a custom resource from an existing Eon Mode database
To simplify Vertica on Kubernetes adoption, Vertica provides the vdb-gen
migration tool that revives an existing Eon Mode database as a StatefulSet in Kubernetes. vdb-gen
generates a custom resource (CR) from an existing Eon Mode database by connecting to the database and writing to standard output.
The vdb-gen
tool is available for download as a release artifact in the vertica-kubernetes GitHub repository.
Use the -h
flag to view a full list of the available vdb-gen
options, including options for debugging and working with environment variables. The following steps generate a CR using basic commands:
-
Execute
vdb-gen
and redirect the output to a YAML-formatted file:$ vdb-gen --password secret --name mydb 10.20.30.40 vertdb > vdb.yaml
The previous command uses the following flags and values:
-
password: The existing database superuser secret password.
-
name: The name of the new custom resource object.
-
10.20.30.40: The IP address of the existing database
-
vertdb: The name of the existing Eon Mode database.
-
vdb.yaml: The YAML formatted file that contains the custom resource definition generated by the vdb-gen tool.
-
-
Use the admintools stop_db command to stop the existing database:
$ /opt/vertica/bin/admintools -t stop_db -d vertdb
Wait for the cluster lease to expire before continuing. For details, see Revive with commuanal storage.
-
Apply the YAML-formatted manifest that was generated by the vdb-gen tool:
$ kubectl apply -f vdb.yaml verticadb.vertica.com/mydb created
Note
For performance purposes, do not apply the manifest to resources that already contain a Vertica on Kubernetes install. -
The operator creates the StatefulSet, installs Vertica on each pod, and runs revive. To view the events generated for the new database, use
kubectl describe
:$ kubectl describe vdb mydb