kinvolk / lokomotive

🪦 DISCONTINUED Further Lokomotive development has been discontinued. Lokomotive is a 100% open-source, easy to use and secure Kubernetes distribution from the volks at Kinvolk
https://kinvolk.io/lokomotive-kubernetes/
Apache License 2.0
321 stars 49 forks source link

Lokoctl should deploy machines on different racks #1327

Open surajssd opened 3 years ago

surajssd commented 3 years ago

Current situation

Currently if a user wants to have nodes on different racks they have to rely on node reservation feature by Packet, which is cumbersome to use and could be error prone. Also this makes it very hard to rotate worker pools.

Also node reservation is only used right now to ensure nodes are scheduled on different racks.

Ideal future situation

For certain worker pools it is necessary that they run on different racks, e.g. control plane, storage, network. The reasons could be HA, network traffic distribution, etc.

Lokoctl should procure machines from Packet on different racks using terraform or using the Packet APIs. This makes it easier to rotate the worker pools and the need for node reservation.

invidian commented 3 years ago

Is this even supported by Packet API?

surajssd commented 3 years ago

I think I was wrong to say that node reservation won't be useful. I think we will still need node reservation, its just that we can make topology aware installation in lokoctl. With the help of the Packet API we can figure out up front which node is located where and then we can install according to our HA preference:

func main() {
    c, err := packngo.NewClient()

    projectID := ""

    options := &packngo.ListOptions{PerPage: 400, Excludes: []string{"project"}}
    hrs, _, err := c.HardwareReservations.List(projectID, options)

    for _, h := range hrs {
        //if h.Device != nil && h.Plan.Class == "c2.medium.x86" {
        if h.Device == nil && h.Plan.Class == "c1.small.x86" {
            fmt.Println(h.ID, h.Device, h.Plan.Class, h.CreatedAt, h.SwitchUUID, h.Plan.Specs.Memory.String())
        }
    }
}
invidian commented 3 years ago

@surajssd so your idea is for user to provide list of reservation IDs and then we will calculate which should be used for what machine based on SwitchUUID?

surajssd commented 3 years ago

@invidian that's correct.

invidian commented 3 years ago

I guess we could do that :+1: