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 type | What it contains | How to back up |
|---|---|---|
| etcd | ACLs, Persistent Queries, schemas, data routing YAML, property files | etcd snapshots (automatic via CronJob or manual) |
| Helm values | Deployment configuration (resources, tolerations, image tags, etc.) | helm get values |
| Secrets | TLS certificates (deephaven-tls), image pull credentials, etcd root password | kubectl get secret -o yaml |
| ConfigMaps | Worker pod templates, cluster config, Envoy config | kubectl get configmap -o yaml |
| Persistent Volumes | Historical data (/db/Systems), user data (/db/Users), intraday data, etcd data | Varies 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 type | Typical backing | Backup approach |
|---|---|---|
NFS shared volumes (/db/Systems, /db/Users) | NFS server | NFS server-level backup or PVC snapshots |
| etcd data volumes | Cloud block storage | Use etcd snapshots (see above), not volume snapshots |
| DIS intraday volumes | Local or block storage | Storage 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-jaror--customer-pluginflags withbuildAllForK8s.sh. This is the recommended approach. - Mount via volumes: Use
workerExtraVolumesin 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:
- Identify the snapshot to restore.
- Delete etcd StatefulSet PVCs.
- Upgrade with
restore.enabled=true,restore.snapshotFilename, andbackup.pvc.existingClaim(all three are required). - 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.