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]: Adding proxy settings in the k8sgpt-operator #307

Closed
4 tasks done
namgizlat opened this issue Jul 2, 2023 · 5 comments · Fixed by k8sgpt-ai/k8sgpt#987 · May be fixed by #415
Closed
4 tasks done

[Question]: Adding proxy settings in the k8sgpt-operator #307

namgizlat opened this issue Jul 2, 2023 · 5 comments · Fixed by k8sgpt-ai/k8sgpt#987 · May be fixed by #415
Assignees

Comments

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

No response

Kubernetes Version

No response

Host OS and its Version

No response

Steps to reproduce

  1. Run k8sgpt analyze --filter=Pod --backend azureopenai --explain
  2. Getting following timeout error:
    Error: failed while calling AI provider azureopenai: Post "https://myopenapitests.azure-api.net/mtx/openai/deployments/gpt-35-turbo-002/chat/completions?api-version=2023-03-15-preview": dial tcp 22.201.29.165:443: i/o timeout

i am working behind proxy and added my proxy details in the deployment of k8sgpt-deployment.

Expected behaviour

No timeout error and response from azureopenai

Actual behaviour

following error:
Error: failed while calling AI provider azureopenai: Post "https://myopenapitests.azure-api.net/mtx/openai/deployments/gpt-35-turbo-002/chat/completions?api-version=2023-03-15-preview": dial tcp 22.201.29.165:443: i/o timeout

Additional Information

i suspect the k8sgpt is trying to connect azure openai directly and not through the proxy

@arbreezy
Copy link
Member

arbreezy commented Nov 9, 2023

You are right @namgizlat , we don't currently support a proxy config for azure openai backend, it seems like a small change though, something close to

config := openai.DefaultConfig("token")
proxyUrl, err := url.Parse("http://{proxyAddress}:{port}")
if err != nil {
	panic(err)
}
transport := &http.Transport{
	Proxy: http.ProxyURL(proxyUrl),
}
config.HTTPClient = &http.Client{
	Transport: transport,
}

c := openai.NewClientWithConfig(config)

I will try to pick it up when I find spare time

@panneer-dev
Copy link

Thanks @arbreezy. Did you manage to find some spare time to take a look at proxy support ?

@AlexsJones AlexsJones transferred this issue from k8sgpt-ai/k8sgpt Jan 4, 2024
@arbreezy
Copy link
Member

arbreezy commented Feb 5, 2024

@panneer-dev the main problem I have is that I don't have anymore an Azure subscription with openai support so I will need someone to test it before we can merge it..

I aim to pick it up this month and introduce it to begin with in main k8sgpt cli and then support it in the operator.

@panneer-dev
Copy link

Thanks @arbreezy let me know if I can help in any way

@deva26
Copy link

deva26 commented Feb 14, 2024

@tanujd11 - FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
4 participants