This task tracks the migration for the patchdemo DB.
Description
Details
| Title | Reference | Author | Source Branch | Dest Branch | |
|---|---|---|---|---|---|
| migrate DB to MariaDB operator: Step 5 | repos/test-platform/catalyst/patchdemo!232 | jnuche | T408118-5 | main | |
| migrate DB to MariaDB operator: Step 4 | repos/test-platform/catalyst/patchdemo!231 | jnuche | T408118-4 | main | |
| migrate DB to MariaDB operator: Step 3 | repos/test-platform/catalyst/patchdemo!230 | jnuche | T408118-3 | main | |
| migrate DB to MariaDB operator: Step 2 | repos/test-platform/catalyst/patchdemo!229 | jnuche | T408118-2 | main | |
| migrate DB to MariaDB operator: Step 1 | repos/test-platform/catalyst/patchdemo!228 | jnuche | T408118-1 | main |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T408114 Migrate bitnami MariaDB charts to MariaDB operator | |||
| Resolved | jnuche | T408118 Migration to MariaDB operator: Patchdemo DB |
Event Timeline
jnuche opened https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/228
migrate DB to MariaDB operator: Step 1
jnuche opened https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/229
migrate DB to MariaDB operator: Step 2
jnuche opened https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/230
migrate DB to MariaDB operator: Step 3
jnuche opened https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/231
migrate DB to MariaDB operator: Step 4
jnuche opened https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/232
migrate DB to MariaDB operator: Step 5
We will announce a maintenance window for the migration.
Migration plan
- Scale down Production Patchdemo while we work on Staging: kubectl -n patchdemo scale deployment patchdemo --replicas=0
- Back up K3s data disc for the control plane host k3s
- Create at least a couple of wikis on Staging
- Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/228 (Deploy operator DB for Staging)
- Perform Manual migration + checks steps for NS=patchdemo-staging
- Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/229 (Remove bitnami DB for Staging)
- Check Staging health. The Staging bitnami PVC should have survived at this point
- Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/230 (Deploy operator DB for Production)
- At this point Production Patchdemo will be scaled up again
- Perform Manual migration + checks steps for NS=patchdemo
- Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/231 (Remove bitnami DB for Production)
- Check Production health. The Production bitnami PVC should have survived at this point
- Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/232
- Success!
Manual migration + checks
For a given Namespace, once the operator DB has been deployed and while the bitnami DB is still up and running, we do the following:
PASS=<rootPass>
NS=<nameSpace>
- Dump patchdemo from bitnami:
- kubectl -n $NS exec $NS-mariadb-0 -- mariadb-dump -u root -p"$PASS" --single-transaction patchdemo (plus all other patchdemo_ DBs) > ~/backupDB-$NS.sql
- Import into operator
- kubectl -n $NS exec -i $NS-mariadbop-0 -- mariadb -u root -p"$PASS"
patchdemo< ~/backupDB-$NS.sql
- kubectl -n $NS exec -i $NS-mariadbop-0 -- mariadb -u root -p"$PASS"
- Manually point Patchdemo deployment to operator DB and perform checks:
- kubectl -n $NS edit deployment.apps/patchdemo -> Edit DB_HOST=patchdemo-mariadbop
- Perform checks
- Undo changes and point back to bitnami DB
jnuche merged https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/228
migrate DB to MariaDB operator: Step 1
jnuche merged https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/229
migrate DB to MariaDB operator: Step 2
jnuche merged https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/230
migrate DB to MariaDB operator: Step 3
jnuche merged https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/231
migrate DB to MariaDB operator: Step 4
jnuche merged https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/232
migrate DB to MariaDB operator: Step 5