Support showing MachineHealthChecks in `clusterctl describe cluster` output
User Story
As a user I would like to be able see MachineHealthChecks acting on a cluster in the at-a-glance view generated by clusterctl describe cluster.
Detailed Description
Currently MHCs are not part of the clusterctl describe cluster output. Since MHCs can be uniquely linked to a specific cluster using MachineHealthCheck.Spec.ClusterName it would be nice to also see them in the output.
Anything else you would like to add:
They can be disabled by default and can sit behind a flag like --show-machinehealthchecks, similar to the other flags we currently have: --show-templates, --show-resourcesets, etc.
/kind feature /area clusterctl
/triage accepted
it makes sense given that we are extending to all the objects in a cluster, but at the same time I'm not really sure what is the best way to represent them given the mechanism they are using to target machines
I guess this can be broken down into 2 things:
- Listing the MachineHealthChecks that are linked to a cluster in
clusterctl describe - Showing which MHCs are acting on which Machines
These things can probably be address in 2 steps.
The first one is probably straight forward to implement with how clusterctl describe works right now.
For the second one, it will need more though on a good UX to show that information.
I think we can do 1 now and implement 2 later once we have a better idea on the UX.
+1 not sure if there's a good way to do 2. considering that MHC (as far as I know) could apply to Machines managed by different resources (KCP,MD)
/help
@fabriziopandini: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/help
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Hey @ykakarap, I would like to work on this.
@rajaSahil Great! Feel free to assign it to yourself.
Sure. Thank you! /assign
Have you had any time to work on this @rajaSahil?
/unassign@rajaSahil
Wondering if what we need is clusterctl describe mhc, we rally neead to figure out what we want to achieve here given the relation betwen [edited]~~crs and clusters is 1:n~~ MHC and machines is 1:n
- Listing the MachineHealthChecks that are linked to a cluster in
clusterctl describe
If everyone agrees 1 is a good feature I would be willing to implement this.
/unassign@rajaSahil
Wondering if what we need is clusterctl describe mhc, we rally neead to figure out what we want to achieve here given the relation betwen crs and clusters is 1:n
MHC to clusters is 1:1 right? MHC is uniquely matched to a Cluster using mhc.spec.clusterName. I guess usecase 1
- Listing the MachineHealthChecks that are linked to a cluster in clusterctl describe Is still a useful thing to have in the clusterctl describe output.
MHC to clusters is 1:1 right?
Yes a MHC always belongs to a specific cluster, while a cluster can have multiple MHCs (which results in a 1:n relationship). So just listing all MHC's belonging to a cluster would be possible.
@fabriziopandini did you simply mix it up with ClusterResourceSet or where you looking for how we could map MHC's in the output to Control plane / MachineDeployments / MachineSets / Machines?
yeah sorry if I wasn't clear and a little bit imprecise, edited.
What I what thinking is a two-step process:
- use
clusterctl describe cluster foo --show-mhcto chek the list of mhc existing in a cluster (no further details provided) - use
clusterctl describe mhc foo-mhc1to get a new view showing the machines targeted by this mhc instance, and might be also their health instead of the ready condition
but we can start from 1 for now
Thanks everyone for the clarifications! I'll give it a try during the weekend.
/assign
I would like to ask for some advice how to look up the mhc(s). Would a viable option be via the management cluster client to use tree.Discovery()?
That sounds like the right way to approach this - i.e. insert a new getMachineHealthChecksForCluster somewhere in this function: https://github.com/kubernetes-sigs/cluster-api/blob/f2ba999757aa76b446943a9ffea14ecf8c7523e8/cmd/clusterctl/client/tree/discovery.go#L65
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
- Confirm that this issue is still relevant with
/triage accepted(org members only) - Close this issue with
/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted
/triage accepted /priority backlog