docker-mailserver / docker-mailserver-helm

Kubernetes Helm chart for docker-mailserver
https://github.com/docker-mailserver/docker-mailserver/
MIT License
85 stars 63 forks source link

Could not mount multiple keys from same ConfigMap or Secret #114

Closed gulecroc closed 4 days ago

gulecroc commented 2 months ago

Hi,

Currently configMaps and secrets format only support one key to be mount.

I would like to mount multiple keys from the same ConfigMap or Secret.

Futhermore I could not set :

I'm able to create a PR but this will break the current format ?

Best regards, Guillaume

cfis commented 2 months ago

volumeMounts for configmaps are set to readonly. See https://github.com/docker-mailserver/docker-mailserver-helm/blob/master/charts/docker-mailserver/templates/deployment.yaml#L111. Are you asking for that to be configurable?

But secrets are not set to readonly, but seems they should be? Are you asking for that to be configurable too?

defaultMode - happy for PR on that one.

As for mounting multiple keys for a configmap as volumes - instead you would create multiple config maps since each config map is meant to contain a single file mounted to disk that is used to configure docker mailserver. Does that work?

gulecroc commented 2 months ago

As for mounting multiple keys for a configmap as volumes - instead you would create multiple config maps since each config map is meant to contain a single file mounted to disk that is used to configure docker mailserver. Does that work?

Yes it totally works if I create one ConfigMap/Secret per key. It's just that this is a "limit" from the current template implementation. But I'm OK if you don't want to change this.

For others subjects I will see next week.

gulecroc commented 1 month ago

I think the best way to add user flexibility for ConfigMap and Secret is to add extraVolumes and extraVolumesMount. So user can set any properties for volume or volumeMount.

I will propose a PR

cfis commented 1 month ago

Users can already add configMaps and secrets using the configMaps and secrets keys in the values.yaml file. So this seems duplicative to me?

gulecroc commented 1 month ago

Hi @cfis, users can add configMaps and secrets using the configMaps and secrets but with limitation :