HomePhabricator
Diffusion Comm 2407fdb79d16

[terraform] Migration script for for self-hosted keyserver

Description

[terraform] Migration script for for self-hosted keyserver

Summary:
This runs a migration on the primary node by doing the following:

  1. Disables traffic to load balancer
  2. Grab the domain and desired secondary node count from terraform.tfvars
  3. Stops all primary and secondary nodes
  4. Waits for health check to fail
  5. Redeploys the primary node, causing the migration to run
  6. Redeploys the secondary nodes
  7. Waits for health check to succeed
  8. Re-enables traffic to load balancer

On running the script on my personal setup, the migration script took 15 minutes

Test Plan:
Script runs successfully. Monitored aws console through the running of the script and confirmed that tasks were being stopped. The primary node was reinitialized and finally the secondary nodes were set to reinitialize.

I set my keyserver nodes to use wyilio/keyserver:latest. I then updated latest to include a test migration which created a new table and populated it with a single random number entry.
Ran my migration script and verified by connecting mysql remotely to MariaDB that the table was being created and there was only a single entry

Reviewers: ashoat, varun, bartek

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D12731

Details

Provenance
willAuthored on Jul 11 2024, 10:02 AM
Reviewer
ashoat
Differential Revision
D12731: [terraform] Migration script for for self-hosted keyserver
Parents
rCOMMb19af1b35ef7: Revert "[native] Temporary changes for staff release"
Branches
Unknown
Tags
Unknown