siderolabs / omni

SaaS-simple deployment of Kubernetes - on your own hardware.
Other
395 stars 24 forks source link

[feature] machines distribution across zones #395

Open vbehar opened 1 week ago

vbehar commented 1 week ago

Problem Description

Hi, we'd like to create MachineSets with machines evenly distributed across availability zones.

Right now, we can only have a single MachineClass linked to a MachineSet, and no way to control how Omni would select the machines in that MachineClass.

We could create multiple MachineSets, 1 per zone, and manage them at a higher level to ensure they scale up/down "together", but it requires more work for our users - which are the ones creating the nodepools (machinesets)

Ideally, this would be an omni feature: the ability to pick machines from different "pools" (I'm not saying MachineClass on purpose) when adding them to a MachineSet - with some kind of distribution strategy.

Solution

One way to implement it would be to add a "label distribution" field in the MachineClass, so that when omni would select machines using the machineClass selector, it would then group them based on this specific label.

and omni would then be able to pick machines from these different groups - also in relation with the currently selected machines in the MachineSet.

Alternative Solutions

Another way to do it would be to add multiple MachineClasses in a MachineSet, and pick machines from each MachineClass in alternate when populating a MachineSet.

Notes

No response

alexandrem commented 1 week ago

Note that this is particularly an issue for the control-planes machineset because there can only be one resource of its kind. That means that we cannot ensure that the CP nodes are located in different failure domains.

I think that there should be richer operators available in the machine class matchLabels to express affinity on label keys.

Unix4ever commented 3 days ago

Proposed structure:

affinity:
  preferred:
    ...
  required:
    ...