Repository navigation
feat: sveltosctl show unhealthy-resources - #455
Merged
Merged
Conversation
Add a show subcommand listing the resources health monitoring found not Healthy, with the profile owning the HealthCheck that reported each of them. When no profile owns the HealthCheck, the HealthCheck is displayed instead. Filters: --namespace, --cluster, --cluster-type, --profile. When nothing is displayed for a cluster, a note explains why: health monitoring is not enabled, no health report has been received yet, or no resource is unhealthy. The ClusterSummary to HealthCheckReport join is the one shared with ui-backend and mcp-server (addon-controller lib/healthmonitoring). The data is selected by the API server so the cost does not grow with the clusters not selected: the HealthCheckReports by namespace and the cluster name and type labels, the generated HealthChecks by the UID of the ClusterSummaries (in batches, metadata only; all the generated ones are listed at once when there are more than 2000). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Adds
sveltosctl show unhealthy-resources, which lists the resources health monitoring found not Healthy. Until nowkubectl get healthcheckreportsshowed anhm-<hash>HealthCheck name that nobody could map back to a profile.For each resource the command displays the profile owning the HealthCheck that reported it. When no profile owns the HealthCheck, the HealthCheck is displayed instead. The worst status comes first. Filters:
--namespace,--cluster,--cluster-typeand--profile. With--profileonly the resources reported through that profile are displayed.When nothing is displayed for a cluster, a note under the table says why: health monitoring is not enabled, no health report has been received yet, or no resource is unhealthy. An empty table is never read as healthy. With
--profilethe note is about that profile.The ClusterSummary to HealthCheckReport join is the shared
lib/healthmonitoringpackage of addon-controller, the same one ui-backend and mcp-server use, so the three cannot diverge.The data is selected by the API server, so the cost does not grow with the clusters not selected:
Measured on a kind cluster with 100 clusters, 20 profiles each and 20,000 unhealthy resources: about 0.5 s for the whole fleet, 0.05 s for one cluster and profile.
Tests are Ginkgo specs: the command (filters, owned and unowned reports, the three notes) and the label selection of reports and HealthChecks, including the batched and the list-all paths.
go.modandgo.summove to the addon-controller and libsveltos versions that containlib/healthmonitoring.🤖 Generated with Claude Code