Skip to content

v1beta2: Improve kmc status report by adding conditions#1365

Open
apedriza wants to merge 3 commits intok0sproject:v1beta2-api-versionfrom
apedriza:improve-kmc-status-report
Open

v1beta2: Improve kmc status report by adding conditions#1365
apedriza wants to merge 3 commits intok0sproject:v1beta2-api-versionfrom
apedriza:improve-kmc-status-report

Conversation

@apedriza
Copy link
Contributor

@apedriza apedriza commented Feb 18, 2026

Proposal for improve k0smotron Cluster status report

Currently, k0smotron Cluster controller does not have a clear report of the reconciliation status using standards kubernetes method like the use of conditions. This changes introduce a clearer status reportir using kubernetes conventions described here

The goal is to give the user the needed report without the need to check inner resources supporting the controlplane like the secrets, configmaps or statefulsets involved.

New conditions

This PR introduces conditions for reporting the current state of the k0smotron cluster. As kubernetes conventions states: Controllers should apply their conditions to a resource the first time they visit the resource. Following that, no matter the state of the k0smotron cluster reconciliation, the conditions will be reported.

New Condition Description
Available Describe cluster availability. It summarizes if the main conditions to consider a cluster is fully available are true: ControlPlaneFunctional, KubeconfigSecretAvailable and ControlPlaneExposed
Deleting Describe if a cluster that is in a deleting phase
CertificatesAvailable Describes if the certificates for the cluster has been created
ControlPlaneFunctional Describes if the cluster is functional. We consider a cluster functional if the kube-system namespace exists in the workload cluster
KubeconfigSecretAvailable Describes if the kubeconfig secret to access the cluster is availablke, i.e, it has been created
ControlPlaneExposed Describes if the service which allows the access to the cluster workloads has populated its external address
ControlPlaneUpToDate Describes if all the replicas for the cluster are up to date with the desired cluster spec
ControlPlaneScaling Describes if the cluster is scaling up or down

New fields

  • readyReplicas: can be used to check how many pods have a Ready condition (same as the readyReplicas field for the inner stateful set. This value, together with the Availability condition, can let the user know how many controlplane instance the load will be balanced across.
  • updatedReplicas : same as updatedReplicas for the inner statefulset. Can led the user know how many replicas runs with the desired state.

Deprecated fields

On the other hand, in favor of new methods for status reporting, Ready condition and .status.ReconcileStatus will be removed in next releases. Currently deprecated and mantained for a while in order to allow back and forth conversions.

  • Ready status presents ambiguity, given it is calculated from the check expected replicas == current ready control plane replicas. The readiness probe is calculated by running k0s status, but that does not guarantee the workload Cluster is fully functional. For that reason, and for more clarity of what the status field represents, Ready condition is substituted by Avaialble condition, which is calculated taking into account conditions that SHOULD guarantee cluster is ready.
  • .status.ReconcileStatus is removed. It is currently used to store logs from the controller. We should be able to report the state of the k0smotron Cluster controller reconciliation by using conditions, which is the standard in kubernetes for reporting resource state.

@apedriza apedriza changed the base branch from v1beta2-api-version to main February 18, 2026 17:48
@apedriza apedriza changed the title Improve kmc status report WIP: Improve kmc status report Feb 18, 2026
@apedriza apedriza force-pushed the improve-kmc-status-report branch 10 times, most recently from 1bbcec8 to 9e672ba Compare February 26, 2026 10:25
@apedriza apedriza changed the base branch from main to v1beta2-api-version February 26, 2026 10:26
@apedriza apedriza changed the title WIP: Improve kmc status report v1beta2: Improve kmc status report Feb 26, 2026
@apedriza apedriza force-pushed the improve-kmc-status-report branch from 9e672ba to 596592c Compare February 26, 2026 15:06
@apedriza apedriza force-pushed the v1beta2-api-version branch from 96078d0 to 8c75d2d Compare February 26, 2026 15:22
@apedriza apedriza marked this pull request as ready for review February 27, 2026 10:52
@apedriza apedriza requested a review from a team as a code owner February 27, 2026 10:52
@apedriza apedriza marked this pull request as draft February 27, 2026 10:52
@apedriza apedriza force-pushed the improve-kmc-status-report branch 2 times, most recently from b694e6b to d1db9d8 Compare March 2, 2026 16:46
@apedriza apedriza force-pushed the v1beta2-api-version branch from d8b1823 to bff3973 Compare March 2, 2026 17:10
@apedriza apedriza force-pushed the improve-kmc-status-report branch 3 times, most recently from 53d87bd to ec5af7c Compare March 3, 2026 16:05
@apedriza apedriza changed the title v1beta2: Improve kmc status report v1beta2: Improve kmc status report by adding conditions Mar 3, 2026
@apedriza apedriza force-pushed the improve-kmc-status-report branch 3 times, most recently from 56b31c8 to ebdf2ec Compare March 4, 2026 10:01
@apedriza apedriza force-pushed the improve-kmc-status-report branch from ebdf2ec to 1e79430 Compare March 4, 2026 12:01
@apedriza apedriza marked this pull request as ready for review March 4, 2026 15:11
@apedriza apedriza force-pushed the v1beta2-api-version branch from 7b8da8a to 2725e5a Compare March 5, 2026 16:33
makhov added 2 commits March 6, 2026 11:08
* v1beta2. wip

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2. controlplane api. wip

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2. controlplane api. wip

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2. linter fixes

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2 contracts

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2 contracts. printcolumns

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2 contracts. review fixes

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

* v1beta2 contracts. pointers everywhere

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>

---------

Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>
Signed-off-by: Alexey Makhov <amakhov@mirantis.com>
Signed-off-by: makhov <amakhov@mirantis.com>
@apedriza apedriza force-pushed the improve-kmc-status-report branch from 1e79430 to 8cd8e82 Compare March 6, 2026 10:18
…s fields

Signed-off-by: apedriza <adripedriza@gmail.com>
@apedriza apedriza force-pushed the improve-kmc-status-report branch from 8cd8e82 to 1fed617 Compare March 6, 2026 10:41
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.

2 participants