File system backup and restoration (Kubernetes)

This guide covers file system backup and restoration for Deephaven Kubernetes deployments. Unlike traditional installations, Kubernetes deployments do not use the /etc/sysconfig/deephaven/illumon.d.latest/ directory structure. Instead, configuration and data are stored in etcd, Helm values, Kubernetes Secrets, ConfigMaps, and Persistent Volumes.

For traditional deployments, see File system backup and restoration. For Podman deployments, see File system backup and restoration (Podman).

Configuration storage locations

Deephaven Kubernetes deployments store configuration in several locations:

Storage typeWhat it containsHow to back up
etcdACLs, Persistent Queries, schemas, data routing YAML, property filesetcd snapshots (automatic via CronJob or manual)
Helm valuesDeployment configuration (resources, tolerations, image tags, etc.)helm get values
SecretsTLS certificates (deephaven-tls), image pull credentials, etcd root passwordkubectl get secret -o yaml
ConfigMapsWorker pod templates, cluster config, Envoy configkubectl get configmap -o yaml
Persistent VolumesHistorical data (/db/Systems), user data (/db/Users), intraday data, etcd dataVaries by storage class

What to back up

etcd snapshots

etcd stores most Deephaven configuration, including ACLs, Persistent Queries, schemas, routing, and property files. The deephaven-etcd Helm chart provides automatic backup via a Kubernetes CronJob when backup.enabled=true (the default).

Verify backups are enabled:

List available snapshots:

Snapshots are named db-YYYY-MM-DD_HH-MM and written to the backup PVC mounted at /snapshots.

Trigger a manual backup:

Copy a snapshot off-cluster:

For detailed etcd backup and restore procedures, see Kubernetes etcd backup and recovery.

Helm values

Back up your Helm release values. These contain deployment configuration that etcd does not store:

Caution

helm get values output includes sensitive values such as auth.rootPassword. Redact credentials before committing to version control, or store these backups in a secrets manager rather than in a repository.

Secrets

Back up critical Secrets. Secret names are configurable via Helm values (envoyTlsSecret, authTrustSecret, authUserSecret). Resolve the actual names from your release and strip cluster-assigned metadata so backups can be applied to a new cluster:

Caution

Secret backups contain sensitive data (passwords, certificates, credentials). Store them securely and restrict access.

Persistent Volume data

Persistent Volume backup depends on your storage class and infrastructure:

Volume typeTypical backingBackup approach
NFS shared volumes (/db/Systems, /db/Users)NFS serverNFS server-level backup or PVC snapshots
etcd data volumesCloud block storageUse etcd snapshots (see above), not volume snapshots
DIS intraday volumesLocal or block storageStorage class snapshots

Caution

Do not rely on storage-class snapshots of etcd data volumes for backup. Independent block-volume snapshots of each etcd member can capture divergent Raft state and produce an inconsistent restore. Always use the etcd snapshot procedure described above.

Note

If using the deephaven-nfs Helm chart, the NFS server's backing PVC (dh-nfs-pvc) contains all shared data. Backing up this PVC captures /db/Systems, /db/Users, and etcd backup snapshots.

Custom JARs and plugins

In Kubernetes, you typically build custom JARs into container images rather than placing them on the file system:

  • Build into images: Use --customer-coreplus-jar or --customer-plugin flags with buildAllForK8s.sh. This is the recommended approach.
  • Mount via volumes: Use workerExtraVolumes in Helm values to mount PVCs containing JARs. See Mounting volumes and secrets to workers.

If you build custom JARs into images, ensure your source JARs and Dockerfiles are backed up in version control.

Automating backups

etcd backups (automatic)

When backup.enabled=true in the deephaven-etcd Helm chart, a CronJob automatically writes snapshots. The default schedule is every 30 minutes. Configure the schedule via Helm values:

Helm values and Secrets backup script

Create a script to back up Helm values and Secrets. Pass your Deephaven namespace as the first argument:

Copy etcd snapshots off-cluster

Add a step to copy etcd snapshots to external storage:

Restore procedures

Restore etcd from snapshot

For detailed etcd restore procedures, see Kubernetes etcd backup and recovery. The basic process is:

  1. Identify the snapshot to restore.
  2. Delete etcd StatefulSet PVCs.
  3. Upgrade with restore.enabled=true, restore.snapshotFilename, and backup.pvc.existingClaim (all three are required).
  4. Disable restore after pods are healthy.

Reapply Helm values

If you need to redeploy with backed-up values:

Recreate Secrets

If Secrets were lost, recreate them from backups. The backup files have cluster metadata stripped, so they can be applied directly:

For the TLS secret, you can also recreate it from the original certificate files:

Verify PVC data

After restore, verify that PVC data is intact:

Using dhconfig in Kubernetes

To use the dhconfig tool for configuration backup and restore in Kubernetes, connect to the management shell:

For more details, see Configuration properties backup and restoration.