Closed mjhumkhawala-ias closed 4 months ago
For ipv6 looks like you need to detect ipv6 format and change
Dial tcp to Dial tcp6
Correction, this is likely the bug https://github.com/k8sgpt-ai/k8sgpt-operator/blob/95944620ffcbf570201657d400e414e2a33ff169/pkg/client/client.go#L61
A literal IPv6 address in hostport must be enclosed in square brackets, as in "[::1]:80", "[::1%lo0]:80".
Did you confirm this working in IPv6 k8s clusters?
actually i havent. doesn
t it work?
actually i haven't. doesn't it work?
The reporter is so they can confirm. I made the changes based on Go documentation. So if they confirm it works, then great. If not, I can bugfix
Do we need to walk this back?
i will test it on minikueb
i tested it on kind (minikube does not support ipv6)
and it works. you can i ip below and logs from controller. it gets ipv6 pod ip.
but calling llm request failed. i guess this is because of my local cluster setting is incomplete.
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Pods(all)[11] ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ NAMESPACE↑ NAME PF READY RESTARTS STATUS IP NODE AGE │
│ k8sgpt-operator-system eks-prod-7f586bdb68-r929q ● 1/1 0 Running fd00:10:244::7 ipv6-control-plane 13m │
│ k8sgpt-operator-system k8sgpt-operator-controller-manager-776d7f5b7f-fg7tm ● 2/2 0 Running fd00:10:244::5 ipv6-control-plane 19m │
llm request failed log
{"level":"info","ts":1710768169.1691122,"caller":"server/log.go:50","msg":"request failed. failed while calling AI provider localai: Post \"https://ap-northeast-2.apistage.ai/v1/solar/chat/completions\": dial tcp: lookup ap-northeast-2.apistage.ai on [fd00:10:96::a]:53: server misbehaving","duration_ms":9,"method":"/schema.v1.ServerService/Analyze","request":"backend:\"localai\" namespa │
│ ce:\"default\" explain:true language:\"ko\" max_concurrency:10 output:\"json\" filters:\"Platform\" filters:\"Service\" filters:\"CronJob\" filters:\"Node\" filters:\"PersistentVolumeClaim\" filters:\"Ingress\"","remote_addr":"[fd00:10:244::5]:45202","status_code":2}
Thanks @JuHyung-Son for testing
Checklist
Is this feature request related to a problem?
Yes
Problem Description
If the k8sGPT operator is configured and set up in a Kubernetes cluster that uses only IPv6 (single stack), it results in an error -
trying to get the results object also returns empty output -
Solution Description
Support running k8sgpt operator in a single stack IPv6 Kubernetes cluster
Benefits
As Kubernetes warms up to IPv6, it becomes advantageous for k8sgpt to also offer support for it.
Potential Drawbacks
No response
Additional Information
The matter was initially brought up in the Slack channel, following which I was recommended to create a GitHub issue.