Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Is there a way to remove a filter? #393

Closed
3 of 4 tasks
rwlove opened this issue Mar 28, 2024 · 4 comments
Closed
3 of 4 tasks

[Question]: Is there a way to remove a filter? #393

rwlove opened this issue Mar 28, 2024 · 4 comments

Comments

@rwlove
Copy link

rwlove commented Mar 28, 2024

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the behavior

Affected Components

  • K8sGPT (CLI)
  • K8sGPT Operator

K8sGPT Version

No response

Kubernetes Version

No response

Host OS and its Version

No response

Steps to reproduce

---
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
  name: k8sgpt-local-ai
  namespace: ai
spec:
  ai:
    backend: localai
    baseUrl: http://localai-local-ai.ai.svc.cluster.local:80/v1
    #model: gpt-3.5-turbo                                                                                                                                                     
    model: ggml-gpt4all-j
    secret:
      name: localai-api-key-secret
      key: localai-api-key
  noCache: false
  version: v0.3.29
  filters:
    - Ingress

This only adds the ingress filter, but how can I remove processing of ingresses?

Expected behaviour

remove a filter

Actual behaviour

add a filter

Additional Information

No response

@arbreezy
Copy link
Member

arbreezy commented Mar 30, 2024

Hey @rwlove, I guess you already tried to remove the filter from your k8sGPT CR ?
In theory in each analysis k8sgpt -operator just reads the current filter list so by removing the

...
filters:
  - Ingress
...   

it should be OK

@rwlove
Copy link
Author

rwlove commented Apr 21, 2024

The question is, "How do I tell k8sGPT to analyse the cluster with all of the filters EXCLUDING Ingress using the CR?"

@arbreezy arbreezy reopened this Apr 21, 2024
@arbreezy
Copy link
Member

@rwlove,
K8sGPT's filters at the moment is a whitelist so there is no clever way to exclude an analyzer, you have to have a list of all the analysers you want to run against your clusters.

If we want to dive into the current implementation there are two conditions re: filters here and here whereby in your scenario you will have to put all the desired analysers in your filter's CR list.

K8sGPT cli can be more intuitive cause it can interact with the config file i.e by using the k8sgpt add/remove filter commands which write to the K8sGPT's config file so there is no need to specify on runtime filters during your analysis k8sgpt analyze --filter X,Z

Hope that answers your question

@rwlove
Copy link
Author

rwlove commented Apr 21, 2024

Thanks, @arbreezy. I came to the conclusion that it would probably be wiser to just fix the error instead of exclude the analyzer, which I think is caused by a false positive described here: k8sgpt-ai/k8sgpt#1075. Thanks for your comments.

@rwlove rwlove closed this as completed Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants