3.2. Managing the Cluster with Helm

Documentation

VoltDB Home » Documentation » VoltDB Kubernetes Administrator's Guide

3.2. Managing the Cluster with Helm

The key to managing VoltDB clusters in Kubernetes is to let the Helm charts do the work for you. As described in Chapter 2, Configuring the VoltDB Database Cluster you can customize every aspect of the database and the cluster using Helm properties and the configuration can be a simple or as complex as you choose. But once you have determined the configuration options you want to use, actually initializing and starting the database cluster is a single command, helm install. For example:

$ helm install mydb voltdb/voltdb                        \
   --values myconfig.yaml                                \
   --set-file cluster.config.licenseXMLFile=license.xml  \
   --set cluster.clusterSpec.replicas=5

Once the cluster is running (what Helm calls a "release"), you can adjust the cluster to stop it, restart it, or resize it, by "upgrading" the release chart, specifying the new value for the number of nodes you want. You upgrade the release using much the same command, except rather than repeating the configuration, you can use the --reuse-values flag. So, for example, to stop the cluster, you simply set the number of replicas to zero, reusing all other parameters:

$ helm upgrade mydb voltdb/voltdb       \
   --reuse-values                       \
   --set cluster.clusterSpec.replicas=0

To restart the cluster after you stop it, you reset the replica count to five, or whatever you set it to when you initially defined and started it:

$ helm upgrade mydb voltdb/voltdb       \
   --reuse-values                       \
   --set cluster.clusterSpec.replicas=5

To resize the cluster by adding nodes you simply upgrade the release specifying the new number of nodes you want. Of course, the new value must meet the requirements for elastically expanding the cluster, as set out in the discussion of adding nodes to the cluster in the VoltDB Administrator's Guide. So, for example, to increase the cluster size by two nodes, you can set the replica count to seven:

$ helm upgrade mydb voltdb/voltdb       \
   --reuse-values                       \
   --set cluster.clusterSpec.replicas=7

One caveat to using the helm upgrade command is that it not only upgrades the release, it checks to see if there is a new version of the original chart (in this example, voltdb/voltdb) and upgrades that too. Problems could occur if there are changes to the original chart between when you first start the cluster and when you need to stop or resize it.

The public charts are not changed very frequently. But if your database is in production for an extended period of time it could be an issue. Fortunately, there is a solution. To avoid any unexpected changes, you can tell Helm to use a specific version of the chart — the version you started with.

First, use the helm list command to list all of the releases (that is, database instances) you have installed. In the listing it will include both the name and version of the chart in use. For example:

$ helm list 
NAME  NAMESPACE  REVISION  UPDATED              STATUS    CHART         APP VERSION 
mydb  default    1         2020-08-12 12:45:30  deployed  voltdb-1.0.0  10.0.0

You can then specify the specific chart version when your upgrade the release, thereby avoiding any unexpected side effects:

$ helm upgrade mydb voltdb/voltdb       \
   --reuse-values                       \
   --set cluster.clusterSpec.replicas=7 \
   --version=1.0.0