Skip to main content
Version: 2.7.3

Persist Chaos Dashboard Data

This document describes how to persist Chaos Dashboard data.

Chaos Dashboard supports SQLite, MySQL, and PostgreSQL as its database backends for persisting data.

SQLite (default)

Chaos Dashboard uses SQLite as the default database engine, and it is recommended to enable PV (Persistent Volumes). To enable PV, set dashboard.persistentVolume.enabled to true. You can find the related configurations in values.yaml as follows:

dashboard:
...
persistentVolume:
# If you are using SQLite as your DB for Chaos Dashboard, it is recommended to enable persistence.
# If enable, the chart will create a PersistenceVolumeClaim to store its state in. If you are
# using a DB other than SQLite, set this to false to avoid allocating unused storage.
# If set to false, Chaos Mesh will use an emptyDir instead, which is ephemeral.
enabled: true

# If you'd like to bring your own PVC for persisting chaos event, pass the name of the
# created + ready PVC here. If set, this Chart will not create the default PVC.
# Requires server.persistentVolume.enabled: true
existingClaim: ""

# Chaos Dashboard data Persistent Volume size.
size: 8Gi

# Chaos Dashboard data Persistent Volume Storage Class.
# If defined, storageClassName: <storageClass>
storageClassName: standard

# Chaos Dashboard data Persistent Volume mount root path
mountPath: /data

# Subdirectory of Chaos Dashboard data Persistent Volume to mount
# Useful if the volume's root directory is not empty
subPath: ""
warning

If Chaos Dashboard component restarts without PV, the data of Chaos Dashboard will be lost and cannot be retrieved.

MySQL

Chaos Dashboard supports MySQL 5.6 and higher versions as the database engine. The example below demonstrates the MySQL database configuration. For details about connection string configuration, refer to the MySQL-Driver for Go.

PostgreSQL

Chaos Dashboard supports PostgreSQL 9.6 and higher versions as the database engine. The example below demonstrates the PostgreSQL database configuration. For details about connection string configuration, refer to libpq connect.

Set TTL (Time To Live) for Chaos Dashboard data

Chaos Dashboard supports setting the expiration time of Chaos Dashboard data. By default, the Event-related data expires after 168h, and the Experiment-related data expires after 336h. If you need to modify it, you can set the dashboard.env.TTL_EVENT and dashboard.env.TTL_EXPERIMENT parameters, like: