why not use the mysql helm template?
it’s a good question. First of all, stable/mysql uses Deployments, and I am personally not a fan of using Deployments for databases when there are StatefulSets designed specially for that case. And the second reason is that I used my own mysql chart which I know well.
why stateful sets?
For mysql – because it’t database, for passbolt server – well, I found it easier to manage PVC with Helm when you have StatefulSet because in this case you can reuse volumes when you delete a chart and then recreate it. You cannot easily reuse pvc with Deployments (or maybe you can and I don’t know how?). Anyway, I can just add option for deploying it either as StatefulSet or as Deployment
why initpods doing move and chown?
I faced the following problem. We need a volume to persist images, mainly
/var/www/passbolt/webroot/img directory. But when I mount empty volume to it then server doesn’t have default images in it; so that’s why copying. Chown – because after mounting new volume it has root ownership for files, and user www-data cannot write or read this directory.
Maybe there is another way to solve this and I am doing it the wrong way – if there is, pls help me I would like to improve the chart and my k8s knowledge