[Question]: Is there a way to remove a filter?
Closed this issue · 4 comments
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
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
The question is, "How do I tell k8sGPT to analyse the cluster with all of the filters EXCLUDING Ingress using the CR?"
@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
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.