groundhog2k / helm-charts

Helm charts for open source applications - ready to use for deployment on Kubernetes
MIT License
69 stars 56 forks source link

Avoid deleting all files in conf.d folder for mysql with subpath mount #1241

Closed Erik-Outreach closed 1 year ago

groundhog2k commented 1 year ago

Mmm..interesting. If I take a look into the container image docker.io/mysql:8.0.33-oracle, there are no other files in /etc/mysql/conf.d by default. I'm wondering which other files might be in this folder by default !?

Erik-Outreach commented 1 year ago

Mmm..interesting. If I take a look into the container image docker.io/mysql:8.0.33-oracle, there are no other files in /etc/mysql/conf.d by default. I'm wondering which other files might be in this folder by default !?

I've required this change because I'm using a custom image which already contains other custom files in this folder, it's right it's probably not needed for official images, but nice for people using custom ones.

groundhog2k commented 1 year ago

What about using the original docker image and use the options customConfig: or extraSecretConfigs: from the helm chart to mount more *.cnf into /etc/mysql/conf.d ?

Erik-Outreach commented 1 year ago

What about using the original docker image and use the options customConfig: or extraSecretConfigs: from the helm chart to mount more *.cnf into /etc/mysql/conf.d ?

I assumed that the file changed changed was the custom.cnf, and I wasn't aware of extraSecretConfigs allowing you to create new files in conf.d folder, right? My change would only apply to people using customConfig: but not using extraSecretConfigs: (that's our case). I've pushed changes now to reflect this idea

groundhog2k commented 1 year ago

I think we don't need this PR, because this chart already allows mixing extraSecretConfigs: and customConfig: section. Look into scripts.yaml. The custom.cnf from customConfig: section and all secrets added in extra extraSecretConfigs: will be copied to /etc/mysql/conf.d by the initContainer. In my opinion a config file should never be part of the container image itself but injected during deployment.

Erik-Outreach commented 1 year ago

I think we don't need this PR, because this chart already allows mixing extraSecretConfigs: and customConfig: section. Look into scripts.yaml. The custom.cnf from customConfig: section and all secrets added in extra extraSecretConfigs: will be copied to /etc/mysql/conf.d by the initContainer. In my opinion a config file should never be part of the container image itself but injected during deployment.

That's a fair point, let's close it and I'll propose to my team to move all image included config.