cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

Support showing MachineHealthChecks in `clusterctl describe cluster` output

Open ykakarap opened this issue 3 years ago • 18 comments

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

ykakarap avatar Sep 15 '22 04:09 ykakarap

/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

fabriziopandini avatar Sep 15 '22 14:09 fabriziopandini

I guess this can be broken down into 2 things:

  1. Listing the MachineHealthChecks that are linked to a cluster in clusterctl describe
  2. 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.

ykakarap avatar Sep 16 '22 22:09 ykakarap

+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)

sbueringer avatar Sep 19 '22 09:09 sbueringer

/help

fabriziopandini avatar Sep 19 '22 09:09 fabriziopandini

@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.

k8s-ci-robot avatar Sep 19 '22 09:09 k8s-ci-robot

Hey @ykakarap, I would like to work on this.

rajaSahil avatar Sep 20 '22 03:09 rajaSahil

@rajaSahil Great! Feel free to assign it to yourself.

ykakarap avatar Sep 20 '22 03:09 ykakarap

Sure. Thank you! /assign

rajaSahil avatar Sep 20 '22 03:09 rajaSahil

Have you had any time to work on this @rajaSahil?

oscr avatar Jan 29 '23 20:01 oscr

/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

fabriziopandini avatar Jan 30 '23 11:01 fabriziopandini

  1. 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.

oscr avatar Jan 31 '23 00:01 oscr

/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

  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.

ykakarap avatar Jan 31 '23 04:01 ykakarap

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?

sbueringer avatar Jan 31 '23 10:01 sbueringer

yeah sorry if I wasn't clear and a little bit imprecise, edited.

What I what thinking is a two-step process:

  1. use clusterctl describe cluster foo --show-mhc to chek the list of mhc existing in a cluster (no further details provided)
  2. use clusterctl describe mhc foo-mhc1 to 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

fabriziopandini avatar Jan 31 '23 21:01 fabriziopandini

Thanks everyone for the clarifications! I'll give it a try during the weekend.

/assign

oscr avatar Feb 01 '23 08:02 oscr

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()?

oscr avatar Feb 13 '23 00:02 oscr

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

killianmuldoon avatar Feb 13 '23 10:02 killianmuldoon

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

k8s-triage-robot avatar Feb 13 '24 11:02 k8s-triage-robot

/triage accepted /priority backlog

fabriziopandini avatar Mar 29 '24 19:03 fabriziopandini