Helm simplifies the process of starting a VoltDB database cluster within Kubernetes by coordinating all the different components involved, including Kubernetes, Docker, and VoltDB. By using the provided Helm charts, it is possible to start a default VoltDB cluster with a single command:
$ helm install mydb voltdb/voltdb \ --set-file cluster.config.licenseXMLFile=license.xml
The name mydb specifies a name for the release you create,
voltdb/voltdb specifies the Helm chart to install, and the --set-file
argument
specifies a new value for a property to customize the installation. In this case, --set-file
specifies the
location of the VoltDB license needed to start the database. The license is the only property you must specify; all other
properties have default values that are used if not explicitly changed.
However, a default cluster of three nodes and no schema or configuration is not particularly useful. So VoltDB provides Helm properties to let you customize every aspect of the database and cluster configuration, including:
Cluster configuration, including size of the cluster, available resources, and so on
Network configuration, including the assignment of ports and external mappings
Database initialization options, including administration username and password, schema, and class files
Database configuration, including the settings normally found in the XML configuration file on non-Kubernetes installations
The following sections explain how to use those properties to make some of the most common customizations to your database. Appendix A, VoltDB Helm Properties provides a full list of the properties, including a brief description and the default value for each.
First, it is useful to understand the different ways you can specify properties on the Helm command line. The following discussion is not intended as a complete description of Helm; only a summary to give you an idea of what they do and when to use them.
Helm offers three different ways to specify properties:
The --set
flag lets you specify individual property values on the command line. You can use
--set
multiple times or separate multiple property/value pairs with commas. For example, the
following two commands are equivalent:
$ helm install mydb voltdb/voltdb \ --set cluster.serviceSpec.clientPort=22222 \ --set cluster.serviceSpec.adminPort=33333 $ helm install mydb voltdb/voltdb \ --set cluster.serviceSpec.clientPort=22222,\ cluster.serviceSpec.adminPort=33333
The --set flag is useful for setting a few parameters that change frequently or for overriding parameters set earlier in the command line (such as in a YAML file).
The --set-file
flag lets you specify the contents of a file as the value for a property. For
example, the following command sets the contents of the file license.xml
as the license for
starting the VoltDB cluster:
$ helm install mydb voltdb/voltdb \
--set-file cluster.config.licenseXMLFile=license.xml
As with --set, You can use --set-file
multiple times or separate multiple property/file pairs
with commas. The --set-file
flag is useful for setting parameters where the value is too
complicated to set directly on the command line. For example, the contents of the VoltDB license file.
The --values flag lets you specify a file that contains multiple property definitions in YAML format. Whereas
properties set on the command line with --set
use dot notation to separate the property hierarchy,
YAML puts each level of the hierarchy on a separate line, with indentation and followed by a colon. For example, the
following YAML file (and --values
flag set the same two properties show in the
--set
example above:
$ cat ports.yaml cluster: serviceSpec: clientPort: 22222 adminPort: 33333 $ helm install mydb voltdb/voltdb \ --values ports.yaml
YAML files are extremely useful for setting multiple properties with values that do not change frequently. You can also use them to group properties (such as port settings or security) that work together to configure aspects of the database environment.
You can use any of the preceding techniques for specifying properties for the VoltDB Helm charts. In fact, you can use
each method multiple times on the command line and mixed in any order. For example, the following example uses
--values
to set the database configuration and ports, --set-file
to identify the
license, and --set
to specify the number of nodes requested:
$ helm install mydb voltdb/voltdb \ --values dbconf.yaml,dbports.yaml \ --set-file cluster.config.licenseXMLFile=license.xml \ --set cluster.configSpec.replicas=5