docker-mailserver / docker-mailserver-helm

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

Added initContainers #125

Closed johnstarxx closed 4 months ago

johnstarxx commented 4 months ago

Added initContainers (with extraVolumes and extraVolumeMounts fields). Also closes: #114.

These fields are need if for example one uses custom CA authority (Step Certificates) and needs to set a custom certificate that needs to be stored in /etc/ssl/certs/. Using an init container, one can mount the certificates to the given folder and run the update-ca-certificates command.

cfis commented 4 months ago

For extra volumes, could we just use the already existing persistence key?

johnstarxx commented 4 months ago

Using extraVolumes is more flexible because it allows mounting any type of volume (e.g., emptyDir, downwardAPI, projected). In my use case, the custom CA certificates are generated at runtime by an initContainer and only need to be available for the lifecycle of the pod, so persistence is not required. This simplifies configuration and ensures up-to-date certificates.

cfis commented 4 months ago

Ok, does this PR work?

https://github.com/docker-mailserver/docker-mailserver-helm/pull/117

So then this one would just be for initcontainers (which matches the subject name).

johnstarxx commented 4 months ago

Yes, I think it might work. The difference between the two is that in PR #117 the extraVolume(s/Mounts) are in the .Values, whereas in this PR they are in the .Values.deployment like in other charts (e.g. argo or cert-manager). There are also charts that use them directly from .Values (prometheus-adapter) it they know that there will be only one deployment).

cfis commented 4 months ago

I see. Thanks!