Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing K0sControlPlane status fields and refactor status calc #774

Merged

Conversation

jnummelin
Copy link
Member

K0sControlPlane was missing some required status fields relating to replicas. https://cluster-api.sigs.k8s.io/developer/providers/control-plane?search=pause#required-status-fields-for-implementations-using-replicas

While this doesn't really break anything when using this in "standalone" fashion, e.g. without ClusterClass, things go south when using with ClusterClass. What happens is that when the CAPI topology controller does not see the expected fields, it'll determine that the CP is still scaling up and hence prevents users from upgrading CP via CC.

Previously we dropped the k0s version suffix from the Machines, in this PR we change it to always include the suffix if given in the CP version. This is to allow e.g. v1.30.0+k0s.0 --> v1.30.0+k0s.1 type upgrades.

@jnummelin jnummelin force-pushed the fix/k0scontrolplane-status-replicas branch from 339f840 to c919732 Compare October 14, 2024 11:04
`K0sControlPlane` was missing some required status fields relating to replicas.
https://cluster-api.sigs.k8s.io/developer/providers/control-plane?search=pause#required-status-fields-for-implementations-using-replicas

While this doesn't really break anything when using this in "standalone" fashion, e.g. without ClusterClass, things go south when using with ClusterClass. What happens is that when the CAPI topology controller does not see the expected fields, it'll determine that the CP is still scaling up and hence prevents users from upgrading CP via CC.

Previously we dropped the k0s version suffix from the Machines, in this PR we change it to always include the suffix if given in the CP version. This is to allow e.g. `v1.30.0+k0s.0` --> `v1.30.0+k0s.1` type upgrades.

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
@jnummelin jnummelin force-pushed the fix/k0scontrolplane-status-replicas branch from c919732 to 8185eb8 Compare October 14, 2024 13:42
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
@jnummelin jnummelin force-pushed the fix/k0scontrolplane-status-replicas branch 6 times, most recently from 1852ad8 to 9061408 Compare October 14, 2024 21:27
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
@jnummelin jnummelin force-pushed the fix/k0scontrolplane-status-replicas branch from 9061408 to e6f0774 Compare October 14, 2024 21:55
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
… ones

This ensures etcd can actually catch up on new nodes before we terminate old ones.

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
…ndling; Increase the timeout a bit

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
… have obsolete status data because of caches and potential status update errors

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
@jnummelin jnummelin marked this pull request as ready for review October 16, 2024 20:48
@jnummelin jnummelin requested a review from a team as a code owner October 16, 2024 20:48
….status.version

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
internal/controller/controlplane/status.go Outdated Show resolved Hide resolved
internal/controller/controlplane/status.go Outdated Show resolved Hide resolved
internal/controller/controlplane/status.go Outdated Show resolved Hide resolved
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
@jnummelin
Copy link
Member Author

Thanks @apedriza , pushed the suggested changes

@jnummelin jnummelin force-pushed the fix/k0scontrolplane-status-replicas branch from 817ea7d to eaf9985 Compare October 18, 2024 10:53
…ut --enable-worker

When running without --enable-worker, the machines never transition into Running state as there's no related Node
objects in the child API.

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
@jnummelin jnummelin force-pushed the fix/k0scontrolplane-status-replicas branch from eaf9985 to a4f18bf Compare October 21, 2024 10:57
…er enabled for CP

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants