Skip to content

Conversation

@rickardsjp
Copy link

TLDR: Adds support for ephemeral emptyDir storage as an alternative to PersistentVolumeClaims when using file-based Perses databases.

Motivation

StatefulSets with PVCs aren't always necessary for Perses. Since the operator creates projects, datasources, and dashboards via HTTP requests on pod startup, ephemeral storage works well for e.g. read-only instances. This eliminates provisioning persistent disks or configuring external databases for such use cases.

This approach follows the Prometheus Operator pattern, which even defaults to emptyDir storage when no storage configuration is specified.

Usage

spec:
  config:
    database:
      file:
        folder: "/perses"
        extension: "yaml"
  storage:
    useEmptyDir: true
    emptyDirSizeLimit: 1Gi  # optional

Creates a Deployment with ephemeral storage. Data is lost on pod restart. Note that the storageClass and size fields are ignored when setting useEmptyDir: true, which also follows the example set by the Prometheus operator.

WDYT?

Currently, depending on the Perses configuration in the
`Perses.Spec.Config`, the reconciler either creates a Deployment or
StatefulSet. However, running Perses as a StatefulSet isn't always
necessary. Since the operator already creates projects, datasources, and
dashboards via HTTP requests when pods are created, ephemeral storage is
fine for use cases like read-only Perses instances. This eliminates the
need to provision a disk for each Perses instance or configure and connect
a SQL database.

Signed-off-by: Jeremy Rickards <[email protected]>
Signed-off-by: Jeremy Rickards <[email protected]>
Signed-off-by: Jeremy Rickards <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant