I've a PHP application that is running fine in Kubernetes, except one scenario. The "problem" is that the application can be extended using plugin. In this case, we're simply adding the plugin to the container, rebuild the container and deploy it again.
Next time the Administrator logs in, he needs to confirm the installation of the plugin. So far so good. But! Our problem is that we cannot uninstall these plugins anymore because the plugins are creating (plugin-specific) tables and entries in different tables within the database.
During the uninstall-process, the plugin removes the tables and so on. But since our application is located in the pods, the files in the file system remains active. So after reloading the page, the application finds the new plugin and will install it again.
Basically, after removing one plugin, we need to rebuild the container without the plugin and deploy it again. Then we can remove the next plugin, rebuild the container and so on... but that's no solution.
So we think there must be another way. The best solution would be to have it installed in a volume, because in this case all pods are using the same volume and we can share them between php-fpm pod and webserver pods. So we can scale them independently from each other. But in this case the question is, if there's anything like a "setup"-container which runs on each deployment. So whenever we upgrade our deployment the container runs once and is uninstalling old plugins / installing new plugins / installing upgrades of our application. In this scenario, our pods need just ReadOnlyMany (ROX) and only one pod (the setup-pod) need write permissions.
I know there're init-containers but as far as I know they're run each time a new pod is started. Is anyone having any suggestion how to solve this issue or faced similar issues?