cluster and cluster-ready units go Ready before any node exists

When deploying a cluster (e.g. rke2-capo), the cluster and cluster-ready units are reported as Ready almost immediately , before even the first control-plane node has come up. This is misleading and unreliable as units like cluster-machines-ready that depend on these are allowed to proceed against a cluster that has no working nodes yet.

Root cause

  1. Flux health checks use kstatus, and CAPI resources are not kstatus-compliant. Right after the cluster HelmRelease creates the CAPI objects , their .status is still empty because the CAPI controllers haven't reconciled them yet. kstatus interprets an empty status as "Ready." Flux marks the unit Ready. This is a race condition - already acknowledged in a code comment in charts/sylva-units/templates/_cluster_healthchecks.tpl · main · Sylva-projects / sylva-core · GitLab
  2. The cluster unit deliberately excludes MachineDeployments from its checks to avoid a CNI deadlock (CNI can't deploy until cluster is Ready, but nodes can't be Ready until the CNI exists). So cluster never waits for worker nodes by design.
  3. The kubeconfig-Secret workaround is not enough. We add the <cluster>-kubeconfig Secret to the checks to reduce the race, but that Secret is created very early (as soon as the cluster CA exists), well before any node is up , so it doesn't force waiting for a node.
  4. cluster-ready also  include MachineDeployments, but they hit the same kstatus race and pass early too.

For e.g. for a cluster unit, reconciliation only took 5 sec

Annotations:  meta.helm.sh/release-name: sylva-units
              meta.helm.sh/release-namespace: sylva-system
              reconcile.fluxcd.io/requestedAt: 2026-07-08T09:03:38
              sylva-units-helm-revision: 1
              sylvactl/reconcileCompletedAt.1.LfKeAE: 2026-07-08T09:03:43
              sylvactl/reconcileStartedAt.1.LfKeAE: 2026-07-08T09:03:38

Solution

Replace the unreliable kstatus checks with Flux healthCheckExprs (CEL-based readiness), which are already used for other non-kstatus-friendly CRDs (e.g. Trident, Rancher). CEL lets us wait the real readiness conditions, so an empty status no longer counts as Ready.

cc: @tmmorin

Edited by Priya Goyal