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]: Use K8SGPT deployed in one cluster to analyze another cluster #391

Closed
kodefoundry opened this issue Mar 28, 2024 · 4 comments
Closed

Comments

@kodefoundry
Copy link

kodefoundry commented Mar 28, 2024

Assume we have 2 independent kubernetes clusters. Lets say we create 2 clusters using Kind named Kind-K8sGPT and another Kind-App
Now

  1. I deploy k8sgpt using operator on Kind-K8sGPT cluster
  2. I deploy my sample demo application in the Kind-App cluster
  3. I follow Monitor multiple clusters, idea and configure Kind-App cluster's kubeconfig as a secret in Kind-K8sGPT cluster.

Expectation: k8sgpt in Kind-K8sGPT cluster should be able to analyze Kind-App cluster and provide the results when I query "kubectl get results -o json -n k8sgpt | jq ."

Is this supposed to work?

I tried this, but it failed.
I see the below errors in the logs

{"level":"info","ts":1711620947.095757,"caller":"server/server.go:68","msg":"binding api to 8080"} {"level":"info","ts":1711620947.0958636,"caller":"server/server.go:83","msg":"binding metrics to 8081"} Error initialising kubernetes client: Get "https://***.**.*.*:443/version": dial tcp ***.**.*.*:443: i/o timeout {"level":"info","ts":1711621006.1122108,"caller":"server/log.go:50","msg":"request failed. Get \"https://***.**.*.*:443/version\": dial tcp ***.**.*.*:443: i/o timeout","duration_ms":30028,"method":"/schema.v1.ServerService/Analyze","request":"backend:\"localai\" anonymize:true language:\"english\" max_concurrency:10 output:\"json\"","remote_addr":"**.**.*.*:51936","status_code":2} Error initialising kubernetes client: Get "https://***.**.*.*:443/version": dial tcp ***.**.*.*:443: i/o timeout {"level":"info","ts":1711621036.158368,"caller":"server/log.go:50","msg":"request failed. Get \"https://***.**.*.*:443/version\": dial tcp ***.**.*.*:443: i/o timeout","duration_ms":30030,"method":"/schema.v1.ServerService/Analyze","request":"backend:\"localai\" anonymize:true language:\"english\" max_concurrency:10 output:\"json\"","remote_addr":"**.**.*.*:50820","status_code":2} Error initialising kubernetes client: Get "https://***.**.*.*:443/version": dial tcp ***.**.*.*:443: i/o timeout {"level":"info","ts":1711621066.2082016,"caller":"server/log.go:50","msg":"request failed. Get \"https://***.**.*.*:443/version\": dial tcp ***.**.*.*:443: i/o timeout","duration_ms":30028,"method":"/schema.v1.ServerService/Analyze","request":"backend:\"localai\" anonymize:true language:\"english\" max_concurrency:10 output:\"json\"","remote_addr":"**.**.*.*:57588","status_code":2} Error initialising kubernetes client: Get "https://***.**.*.*:443/version": dial tcp ***.**.*.*:443: i/o timeout {"level":"info","ts":1711621096.2409728,"caller":"server/log.go:50","msg":"request failed. Get \"https://***.**.*.*:443/version\": dial tcp ***.**.*.*:443: i/o timeout","duration_ms":30001,"method":"/schema.v1.ServerService/Analyze","request":"backend:\"localai\" anonymize:true language:\"english\" max_concurrency:10 output:\"json\"","remote_addr":"**.**.*.*:48490","status_code":2} Error initialising kubernetes client: Get "https://***.**.*.*:443/version": dial tcp ***.**.*.*:443: i/o timeout

@kodefoundry
Copy link
Author

Can someone provide some inputs to debug, where to start looking??

@JuHyung-Son
Copy link
Contributor

i think this is network issue.
check two clusters can communicate each other

@kodefoundry
Copy link
Author

Yes this was an issue with kubeconfig. It worked after had the kubeconfig fixed

@kodefoundry
Copy link
Author

I am able to scan other clusters k8sgpt deployed in a separate cluster

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