lawrencegripper / azurefrontdooringress

MIT License
10 stars 4 forks source link

Locking: Limit updates to a single cluster at a time #11

Open lawrencegripper opened 5 years ago

lawrencegripper commented 5 years ago

As multiple clusters can run the ingress and roll up to single frontdoor we need to ensure that updates only take place from a single cluster at a time.

This is because an update is two steps:

  1. Read the current state of Frontdoor
  2. Locally add/remove routes
  3. Write back the updated state to Frontdoor

If a 2 clusters do this at the same time there is a chance they will trample on each others changes so we need to have a global lock before proceeding.

My plan is to use Azure blob leases to provide this locking.

lawrencegripper commented 5 years ago

Creating a locking structure felt like enough of a different project that I've spun this out separately here - https://github.com/lawrencegripper/goazurelocking/

Just finalizing changes to the codebase now before importing