csharp
csharp copied to clipboard
Cannot connect to Azure kubernetes cluster using c# sdk
Describe the bug A clear and concise description of what the bug is.
Kubernetes C# SDK Client Version
e.g. 12.1.1
Server Kubernetes Version
e.g. 1.25.5
Dotnet Runtime Version e.g. net6
To Reproduce Following this doc: https://github.com/kubernetes-client/csharp/blob/master/README.md var namespaces = client.CoreV1.ListNamespace(); foreach (var ns in namespaces.Items) { Console.WriteLine(ns.Metadata.Name); var list = client.CoreV1.ListNamespacedPod(ns.Metadata.Name); foreach (var item in list.Items) { Console.WriteLine(item.Metadata.Name); } }
The above code does not work on the line : var namespaces = client.CoreV1.ListNamespace(); Code/visual studio 2022 hangs there I am using this c# kubernetes client library with client.CoreV1.ListNamespace(); I tried setting KUBECTL_PROXY and updating the host to http: //proxyip:8001 and I am not using kube login. code execution stops at the above line and my visual studio 2022 hangs and I see messages thread exited in the output window. I can get all the details by connecting to cluster using kubectl commands in the terminal window. but not through c# libraray.
Expected behavior expect to list namespaces
KubeConfig normal AKS kube config file , which I can be able to connect using kubectl
Where do you run your app with Kubernetes SDK (please complete the following information):
- OS: [Windows]
- Environment [desktop application]
- Cloud [Azure]
Additional context Add any other context about the problem here.