siderolabs / omni

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

[feature] omni should not delete a machineclass used by an existing cluster #431

Open vbehar opened 2 days ago

vbehar commented 2 days ago

Problem Description

I removed an "old" machineclass, but in fact I forgot that it was still used by an existing cluster (by its control-planes machineset)

later, we I tried to create a new cluster, with another machineclass, I got the following error on its control-planes machineset:

metadata:
    namespace: default
    type: MachineSetStatuses.omni.sidero.dev
    id: 202d1aab-f42a-4fc7-bba2-be797bb72c14-control-planes
    version: 1
    owner: MachineSetStatusController
    phase: running
    created: 2024-07-01T07:53:01Z
    updated: 2024-07-01T07:53:00Z
    labels:
        omni.sidero.dev/cluster: 202d1aab-f42a-4fc7-bba2-be797bb72c14
        omni.sidero.dev/role-controlplane:
spec:
    phase: 5
    ready: false
    error: control plane machine set must have at least one node
    machines:
        total: 0
        healthy: 0
        connected: 0
        requested: 1
    confighash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
    machineclass:
        name: some-machineclass-name
        machinecount: 1
        allocationtype: 0

it seems like the reconciliation loop was blocked because my older cluster couldn't find its machineclass anymore

Solution

an easy fix would be to deny deleting a machineclass if it's still used by an existing machineset

Alternative Solutions

No response

Notes

No response