Skip to content

(feat): Add support for auto-mounting extra configs#42

Closed
utdrmac wants to merge 7 commits intovalkey-io:mainfrom
utdrmac:userconfigs
Closed

(feat): Add support for auto-mounting extra configs#42
utdrmac wants to merge 7 commits intovalkey-io:mainfrom
utdrmac:userconfigs

Conversation

@utdrmac
Copy link

@utdrmac utdrmac commented Jan 7, 2026

This PR adds support for auto-discovery of a user-created Secret, or ConfigMap, that is named $clusterName-conf, which is then mounted into each pod under /config/valkey.conf.d/

The default configmap provided by the operator was modified to include the above directory for additional configs.

This operator design pattern follows a similar one found in Percona's database Operators (MySQL, Mongo, PG) where users can provide additional database configs by creating configMaps with a specific naming convention.

Signed-off-by: utdrmac <matthew.boehm@percona.com>
Signed-off-by: utdrmac <matthew.boehm@percona.com>
Signed-off-by: utdrmac <matthew.boehm@percona.com>
Signed-off-by: utdrmac <matthew.boehm@percona.com>
Signed-off-by: utdrmac <matthew.boehm@percona.com>
@utdrmac
Copy link
Author

utdrmac commented Jan 8, 2026

@sandeepkunusoth I removed the Volumes member from the Spec

// First, look for a Secret named "$clusterName-conf"
err := c.Get(ctx, userConfigFilter, &corev1.Secret{})
if err == nil {
log.V(1).Info("found user-created secret config")
Copy link
Member

@sandeepkunusoth sandeepkunusoth Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pass "$clusterName-conf" from the input spec so users can optionally provide any existing ConfigMap if needed. Also, getUserConfigVolume / userConfig should only be used when this new custom field is set in the spec; otherwise, the default behavior should remain not to use any existing resource.

we need to agree on spec changes with others. Please update spec design or feel free to start discussion. not sure if this feature is priority for others.

// Attach script volume, and config volumes to cluster
if err := attachVolumesToCluster(ctx, r.Client, cluster); err != nil {
// Get script volume, default config, and user config volumes
configVolumes, err := getConfigVolumes(ctx, r.Client, cluster)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this getConfigVolumes call to inside createDeployment. this way we dont need to pass it as param?

@utdrmac utdrmac changed the title Add support for auto-mounting extra configs (feat): Add support for auto-mounting extra configs Jan 9, 2026
Signed-off-by: utdrmac <matthew.boehm@percona.com>
@utdrmac
Copy link
Author

utdrmac commented Jan 9, 2026

I'm closing this one for now, in favor of a simplified config option #44

@utdrmac utdrmac closed this Jan 9, 2026
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.

2 participants