Persistence Chaos Dashboard

This document describes how to make Chaos Dashboard persistence.

Chaos Dashboard support SQLite, MySQL and PostgreSQL as database backends for persistence.

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 related configurations on value.yaml as follows:

  1. dashboard:
  2. ...
  3. persistentVolume:
  4. # If you are using SQLite as your DB for Chaos Dashboard, it is recommended to enable persistence.
  5. # If enable, the chart will create a PersistenceVolumeClaim to store its state in. If you are
  6. # using a DB other than SQLite, set this to false to avoid allocating unused storage.
  7. # If set to false, Chaos Mesh will use an emptyDir instead, which is ephemeral.
  8. enabled: true
  9. # If you'd like to bring your own PVC for persisting chaos event, pass the name of the
  10. # created + ready PVC here. If set, this Chart will not create the default PVC.
  11. # Requires server.persistentVolume.enabled: true
  12. existingClaim: ""
  13. # Chaos Dashboard data Persistent Volume size.
  14. size: 8Gi
  15. # Chaos Dashboard data Persistent Volume Storage Class.
  16. # If defined, storageClassName: <storageClass>
  17. storageClassName: standard
  18. # Chaos Dashboard data Persistent Volume mount root path
  19. mountPath: /data
  20. # Subdirectory of Chaos Dashboard data Persistent Volume to mount
  21. # Useful if the volume's root directory is not empty
  22. subPath: ""

Persistence Chaos Dashboard - 图1danger

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

MySQL

Chaos Dashboard supports MySQL 5.6 and higher versions as the database engine. The below example demonstrates 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 below example demonstrates 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. The default Event related data expires by 168h, and the Experiment related data defaults to 336h. If you need to modify it, you can set dashboard.env.TTL_EVENT and dashboard.env.TTL_EXPERIMENT parameters, like: