MariaDB
WilliamsNet MariaDB General Database
This is a mostly standard deployment of MariaDB using the bitnami helm chart (https://hub.kubeapps.com/charts/bitnami/mariadb).
The primary customization is the use of fixed PVs since the production cluster does not support dynamic provisioning of PVs. The custom 'values.yaml' reflects those changes as well as a couple other minor updates. The MariaDB installation is also placed in its own namespace.
Installation
- Create the namespace
- Create the PV
- Use helm to install the application
The script 'install.sh' performs these steps with the correct parameters in the right order.
Uninstall
If the deployment needs to be removed:
- Use helm to uninstall the application (don't forget the '--purge' option)
- Remove the PV and PVC using 'kubectl delete -f'
- Delete the namespace using 'kubectl delete ns mariadb'
This leaves the database files in place, should you want to reinstall. if you are trying to reset the app due to a configuration issue, you may need to go in and delete the files from the directory (/shared/mariadb) ... but that will erase ALL content ... so beware.
Reinstall
Reinstalling the application on top of an existing database/configuration is problematic for two reasons, both of them relating to the database passwords:
- Unless you provide passwords, the helm chart will generate new random passwords for each install -- which will not line up with the old passwords in the database that is still around.
- The LocalSettings.php file is where the mediawiki app itself stores the password for the database (in clear text ...) -- so even if the app is reinstalled, the LocalSettings.php is not overwritten, and therefore the old password is still there.
You can solve this problem before you start by simply specifying the passwords in the 'values.yaml' file:
- 'db.password' = '<password>'
- 'db.rootUser.password' = '<rootpassword>'
If you forget to do this (or somehow the database passwords get changed) you will have to access the database from OUTSIDE the pod and reset the root password using any of the multiple web pages that tell you how to do it. THEN, you will have to update the secret 'mariadb' with the new passwords (if the application is installed) or set it in the values.html files before you reinstall.