Skip to content

Store Perses server config in a Kubernetes Secret instead of ConfigMap #322

@slashpai

Description

@slashpai

Component(s)

Perses

What is missing? Please describe.

After looking into #206, #216 and #183

A few thoughts:

Edit after testing:

The Perses server configuration is currently stored in a ConfigMap. Sensitive configuration data (database credentials, OAuth secrets, encryption keys) should be stored in a Kubernetes Secret rather than a ConfigMap.

workaround now:

Users can use provisioning.secretRefs to mount K8s Secrets as files, then reference them via _file fields (e.g., password_file, client_secret_file). However this is tedious users must manually construct file paths using the internal mount convention (/etc/perses/provisioning/secrets/{name}-{key}), and not all fields have _file alternatives (e.g., client_id).

Describe alternatives you've considered.

Store the Perses server config in a Kubernetes Secret instead of a ConfigMap, bypassing the secret.Hidden masking during marshaling.

  • Follows prometheus-operator pattern: prometheus-operator stores generated Prometheus and Alertmanager configs in Secrets rather than ConfigMaps.
  • most clusters grant broader ConfigMap read access but restrict Secret access

This change alone does not fix #206 (the secret.Hidden masking issue). secret.Hidden as values are masked at the Kubernetes API server level before the operator reads the CR. Fixing #206 requires a separate CRD API change (e.g., secretKeyRef support)

Environment Information

Environment

Kubernetes Version: 1.35
Perses-Operator Version: main

Metadata

Metadata

Assignees

Labels

kind/featureNew feature or requestneeds-triageNeeds triaging issue from maintainers

Type

No type
No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions