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]: Operator keeps on calling openai api #1268

Open
3 of 4 tasks
smartaquarius10 opened this issue Oct 9, 2024 · 3 comments
Open
3 of 4 tasks

[Question]: Operator keeps on calling openai api #1268

smartaquarius10 opened this issue Oct 9, 2024 · 3 comments
Labels
question Further information is requested suggestion

Comments

@smartaquarius10
Copy link

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

v0.0.26

Kubernetes Version

v1.29.8

Host OS and its Version

No response

Steps to reproduce

Host the operator after following steps written here

https://github.com/k8sgpt-ai/k8sgpt-operator

Expected behaviour

Call openai api only once for analysis and do not call it again and again while pushing duplicate logs in slack.

Actual behaviour

As per my understating, it seems that when multiple logs for the same error are being pushed in the pod, the OpenAI API is being called again to fetch the output. If this is correct, it may not be cost-effective.

I might be wrong. Can someone confirm

Additional Information

No response

@AlexsJones
Copy link
Member

The Operator does not have a client for OpenAI, that would come from the K8sGPT deployment.
Can you show us your K8sGPT custom resource? --no-cache mode will have this behaviour.

@smartaquarius10
Copy link
Author

@AlexsJones I have copy pasted what's written here https://github.com/k8sgpt-ai/k8sgpt-operator#run-the-example..

I’ve noticed that K8sGPT generates the same logs multiple times to the sink. For example, if there’s a POD with an OOM issue, it was pushing the same logs repeatedly to the slack. Before each log is sent, does K8sGPT maintain a cache, or does it call the OpenAI API every time before sending the message?

I’m not very experienced with networking, but I tried using Kubeshark and observed that before sending logs to Slack, it performs a DNS check for OpenAI. This made me think it could be calling openai multiple times. I could be wrong, though. I'd appreciate your thoughts on this.

@AlexsJones
Copy link
Member

Are you seeing data in Results? What is the log for K8sGPT-sample pod?

@AlexsJones AlexsJones added question Further information is requested suggestion labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested suggestion
Projects
Status: Proposed
Development

No branches or pull requests

2 participants