Add ability to exclude a server from acting as a database server in a cluster
The main use case for this is when running a cluster that's got a mix of physical servers and virtual machines as cluster members. This is somewhat common for security reasons where you want a single unified control plane but don't want containers running directly on bare metal, so you create a few VMs that themselves run Incus and are joined into the cluster, then containers get scheduled within those VMs.
The problem with that setup is that those VMs may get elected to run the Incus database, allowing for the situation where both a VM and its host are both database voters. Losing that physical server would then take out a majority of the database voters and end up breaking the database.
We should introduce some kind of cluster role, like database-client which then prevents the affected cluster member from getting elected to voter or stand-by within the cowsql cluster.
Hi @stgraber! @pi2chen and I are interested in working on this issue as part of Professor Chidambaram's Virtualization class. Could you assign this issue to us?
Looking forward to working in this repo, thanks!
I've assigned it to you, I can only assign it to people who have commented in the issue, so will add @pi2chen once he's also commented in here.
Note that this isn't an issue marked as Easy so it's slightly less well defined than the others. I understand what we'd want out of this. Adding the DB role will be easy enough, but it will also need a bit of tweaking on the cowsql configuration side of things which may come with some unknowns.
@freeekanayaka is the author of cowsql and one of the maintainers of Incus so he may be able to provide some pointers on whether there's anything we need to do at the cowsql level, or if all of the role handling is within Incus (which would be easiest for this issue).
Hey folks, the logic for role management is entirely within Incus, see the Rebalance() function in internal/server/cluster/membership.go.
So there should be no change needed at the cowsql level, just an Incus level change.
Excellent, should make this reasonably easy then!
Excited to work on this issue as well.
Hi @stgraber, just a quick note that @cory-chang and I will no longer be working on this issue as the class we were contributing through has concluded. Thanks so much for the great experience! Wishing you and the project all the best.