Skip to content

Cannot connect to Azure kubernetes cluster using c# sdk  #1480

Closed as not planned
@Ranjit-Kumar-Konjeti

Description

@Ranjit-Kumar-Konjeti

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions