Cross-cluster leader election for Kubernetes workloads is typically limited to a single cluster because it relies on the Kubernetes API's Lease resource. This post demonstrates how to replace that backend with PostgreSQL by implementing the `resourcelock.Interface` from client-go, enabling coordination across multiple clusters.

18m read timeFrom itnext.io
Post cover image
Table of contents
TL;DROverviewLeader Election in KubernetesDatabase setup and migration executionpgleele/cmd/migrate/main.go at 9f809dc3c13c9858d12cbd93cba740e0974f5873 · akyriako/pgleeleImplementing the PostgreSQL resource lockImplementing a sample workloadGet Akriotis Kyriakos ’s stories in your inboxSimulating leader election across multiple instancesConclusionGitHub - akyriako/pgleele

Sort: