Skip to content

Commit

Permalink
Add "2ha.sh" script, managing 2-node Canonical K8s HA AA clusters
Browse files Browse the repository at this point in the history
Scenario overview:

* Canonical K8s cluster containing 2 nodes
* Dqlite data store (unable to obtain quorum)
* Primary node dqlite files stored on DRBD
  * sync block-level replication between the two nodes
* cluster monitoring and failover handled through Pacemaker

Script functionality:

* boostrap the service
  * wait for a DRBD primary to be elected
  * detect the node role based on the DRBD status and Dqlite state
    * have the replica wait for the primary to be ready before continuing
  * recover Dqlite after failovers
  * transfer and apply recovery files to secondary nodes
  * transfer Dqlite files to DRBD and other backup locations, creating
    necessary symlinks
* install required packages
* purge all K8s data
* clear Pacemaker taints
* remove recovery data

"2ha.sh start_service" is intended to be used as part of a systemd
unit that bootstraps the k8s services, coordinating with the other
node and taking any necessary steps to recover Dqlite.
  • Loading branch information
petrutlucian94 committed Sep 23, 2024
1 parent 5fe3c27 commit 3ab1cec
Showing 1 changed file with 823 additions and 0 deletions.
Loading

0 comments on commit 3ab1cec

Please sign in to comment.