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-genand redirect the output to a YAML-formatted file:$ vdb-gen --password secret --name mydb 10.20.30.40 vertdb > vdb.yamlThe previous command uses the following flags and values:
-
password: The existing database superuser secret password.
-
name: The name of the new custom resource object.
Important
Resource type names cannot contain underscore characters. The resource type name is used in the fully qualified domain name (FQDN), and FQDNs do not allow underscore characters. You must provide a valid name that follows Kubernetes guidelines.
For example, the default subcluster name that the Vertica server generates is
default_subcluster. This name is invalid for Kubernetes resource types. -
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 vertdbWait for the cluster lease to expire before continuing. For details, seeReviving an Eon Mode database cluster.
-
Apply the YAML-formatted manifest that was generated by the vdb-gen tool:
$ kubectl apply -f vdb.yaml verticadb.vertica.com/mydb createdNote
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