Skip to content

(feat) classify managed clusters from management-cluster resources#482

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:mgmt-classifier
Jun 28, 2026
Merged

(feat) classify managed clusters from management-cluster resources#482
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:mgmt-classifier

Conversation

@gianlucam76

@gianlucam76 gianlucam76 commented Jun 28, 2026

Copy link
Copy Markdown
Member

The existing Classifier evaluates rules against resources inside each managed cluster and applies labels based on what it finds there. This works well, but leaves a gap: there is no way to label managed clusters based on resources that live on the management cluster itself.

A concrete example is an Internal Developer Platform backed by Crossplane. When a team orders an addon, a Crossplane Composite Resource is created on the management cluster. The platform needs to label the target cluster in response so that Sveltos can deploy the right addons. But sveltos-agent only sees the managed cluster, not the management cluster, so the existing Classifier cannot help here.

This PR introduces a new feature to cover that gap. A ManagementClusterClassifier watches resources on the management cluster and runs a Lua function that receives the full set of matched resources and returns which managed clusters should be labeled. Because the evaluation happens entirely on the management cluster, no deployment to managed clusters is needed.
A ManagementClusterClassifierReport tracks the label ownership state per classifier/cluster pair, enabling the same conflict detection the existing Classifier provides through the keymanager.

Fixes #375

The existing Classifier evaluates rules against resources inside each managed cluster
and applies labels based on what it finds there. This works well, but leaves a gap: there
is no way to label managed clusters based on resources that live on the management cluster
itself.

A concrete example is an Internal Developer Platform backed by Crossplane. When a team orders
an addon, a Crossplane Composite Resource is created on the management cluster. The platform
needs to label the target cluster in response so that Sveltos can deploy the right addons.
But sveltos-agent only sees the managed cluster, not the management cluster, so the existing
Classifier cannot help here.

This PR introduces a new feature to cover that gap.
A ManagementClusterClassifier watches resources on the management cluster and runs a Lua function
that receives the full set of matched resources and returns which managed clusters should be labeled.
Because the evaluation happens entirely on the management cluster, no deployment to managed clusters
is needed.
A ManagementClusterClassifierReport tracks the label ownership state per classifier/cluster pair,
enabling the same conflict detection the existing Classifier provides through the keymanager.
@gianlucam76 gianlucam76 merged commit 339287a into projectsveltos:main Jun 28, 2026
14 checks passed
@gianlucam76 gianlucam76 deleted the mgmt-classifier branch June 28, 2026 14:30
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.

Feature Request: Allow deployedResourceConstraint to evaluate resources in the management cluster

1 participant