Repository navigation
feat: Add health monitoring: cluster health status and /clusterHealth endpoint - #193
Merged
Merged
Conversation
… endpoint Expose the health of the resources Sveltos deploys (profiles with spec.healthMonitoring.enabled) so the dashboard can show it per cluster and per profile. ui-backend joins three things: the ClusterSummaries (which profile has monitoring enabled), the HealthChecks addon-controller generates for them (found by label and annotations, never by name) and the HealthCheckReports. The join is the shared addon-controller lib/healthmonitoring package, so the cluster list, the profile rows and the detail view cannot diverge. Cache: a new healthCache in internal/server with its own lock, filled by two new controllers (HealthCheck, metadata only and filtered to generated checks; and HealthCheckReport) plus the existing ClusterSummary controller. Events can arrive in any order: each updates its own maps and recomputes only the cluster it touches. The report cache drops the collected resources (ResourceStatuses[].Resource), which are never read and are the only large field. API: - ManagedCluster.healthStatus on /capiclusters and /sveltosclusters. - healthStatus on each /getClusterStatus row, for the profile. - New GET /clusterHealth: the resources that are not Healthy, worst first, each with group, version, kind, namespace, name, status, message and the profiles owning the check. Filters profile_kind, profile_namespace, profile_name, resource_kind, resource_namespace, resource_name, plus limit and skip. Resources reported by a HealthCheck no profile owns are listed without profiles and carry the HealthCheck name. - healthStatus is omitted when no profile on the cluster has monitoring enabled. Values: NoData, Healthy, Suspended, Progressing, Degraded. RBAC: get/list/watch on healthchecks and healthcheckreports (role.yaml and manifest.yaml). The helm chart needs the same rules.
gianlucam76
force-pushed
the
health-monitoring
branch
from
October 16, 2026 13:33
5b9508e to
8afaca0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose the health of the resources Sveltos deploys (profiles with spec.healthMonitoring.enabled) so the dashboard can show it per cluster and per profile.
ui-backend joins three things: the ClusterSummaries (which profile has monitoring enabled), the HealthChecks addon-controller generates for them (found by label and annotations, never by name) and the HealthCheckReports. The join is the shared addon-controller lib/healthmonitoring package, so the cluster list, the profile rows and the detail view cannot diverge.
Cache: a new healthCache in internal/server with its own lock, filled by two new controllers (HealthCheck, metadata only and filtered to generated checks; and HealthCheckReport) plus the existing ClusterSummary controller. Events can arrive in any order: each updates its own maps and recomputes only the cluster it touches. The report cache drops the collected resources (ResourceStatuses[].Resource), which are never read and are the only large field.
API:
RBAC: get/list/watch on healthchecks and healthcheckreports (role.yaml and manifest.yaml). The helm chart needs the same rules.