Updating#
-
Download newest charts using Helm.
-
Check with
helm difffor changes (https://github.com/databus23/helm-diff). -
Back up the Lagoon databases prior to any Helm actions. We also suggest scaling the API to a single pod, to aid the database migration scripts running in the initContainers.
-
Run the upgrade using Helm.
-
Re-scale the API pods back to their original level.
Check https://github.com/uselagoon/lagoon/releases for additional upgrades.
Database Backups#
You may want to back up the databases before upgrading Lagoon Core, the following will create backups you can use to restore from if required. You can delete them afterwards.
API DB#
Back up API DB
kubectl --namespace lagoon-core exec -it lagoon-core-api-db-0 -- \
sh -c 'mysqldump --max-allowed-packet=500M --events \
--routines --quick --add-locks --no-autocommit \
--single-transaction infrastructure | gzip -9 > \
/var/lib/mysql/backup/$(date +%Y-%m-%d_%H%M%S).infrastructure.sql.gz'
Keycloak DB#
Back up Keycloak DB
kubectl --namespace lagoon-core exec -it lagoon-core-keycloak-db-0 -- \
sh -c 'mysqldump --max-allowed-packet=500M --events \
--routines --quick --add-locks --no-autocommit \
--single-transaction keycloak | gzip -9 > \
/var/lib/mysql/backup/$(date +%Y-%m-%d_%H%M%S).keycloak.sql.gz'