k8sgpt icon indicating copy to clipboard operation
k8sgpt copied to clipboard

[Feature]: Exclude a list of known issues

Open xavpaice opened this issue 1 year ago • 7 comments

Checklist

  • [X] I've searched for similar issues and couldn't find anything matching
  • [ ] I've discussed this feature request in the K8sGPT Slack and got positive feedback

Is this feature request related to a problem?

No

Problem Description

When I run k8sgpt analyze there are a few results that I know about, and I'd like to exclude.

E.g.:

➜  ~ k8sgpt --kubeconfig ~/work/remote-kube.conf analyze
Service openebs/openebs.io-local does not exist

0 minio/ha-minio(ha-minio)
- Error: Service has no endpoints, expected label app=ha-minio

I know that these two are present, and don't want to be reminded about that to reduce the noise. I want to see new issues, so that when something is broken I know the messages shown are relevant.

Solution Description

I would like to be able to supply a config file (json?) of error descriptions that can be excluded/ignored.

Benefits

This means clusters with some minor, known, issues can take advantage of the analyzer when something new comes up, and the results can be shown to folks who are unfamiliar with the results from when the cluster is working fine.

Potential Drawbacks

The issues are likely valid, and should be fixed, and removing the visibility of them will discourage best practices.

Additional Information

I didn't get access to the Slack to discuss this, and don't know how to get that.

xavpaice avatar May 03 '23 06:05 xavpaice

Is anyone working on this? If no then I'd like to take this up.

rakshitgondwal avatar May 10 '23 13:05 rakshitgondwal

We have no concensus on the design yet, do you want to propose something first @rakshitgondwal ?

AlexsJones avatar May 10 '23 16:05 AlexsJones

@rakshitgondwal any follow up on this?

AlexsJones avatar Jun 05 '23 10:06 AlexsJones

I'll try come up with a draft proposal in the next week.

rakshitgondwal avatar Jun 05 '23 12:06 rakshitgondwal

Update: Will be traveling to KCD Mumbai this weekend so will submit a draft next week.

rakshitgondwal avatar Jun 14 '23 18:06 rakshitgondwal

@AlexsJones, @xavpaice, would passing a JSON file containing an exceptions object using an -exceptions flag be a good idea?

This object can be passed to the analyze command, and maybe then we can process the exceptions and exclude them from results if they're present.

And I think that we can support exceptions based on the following fields:

Kind         string    `json:"kind"`
Name         string    `json:"name"`
Error        []Failure `json:"error"`
Details      string    `json:"details"`
ParentObject string    `json:"parentObject"`

Along with support for regular expressions.

VaibhavMalik4187 avatar Jan 24 '24 16:01 VaibhavMalik4187

@arbreezy mind sharing your thoughts on this? Thanks!

VaibhavMalik4187 avatar Jan 27 '24 20:01 VaibhavMalik4187