csharp: Forbidden error with every request
I’m just trying to connect to my local kubernetes cluster on my machine. I have the current context set to be docker-desktop:

And I can use kubectl without any errors:

I just have this very minimal example code:
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
var client = new Kubernetes(config);
var ns = await client.ReadNamespaceAsync("default");
Which ends up throwing a forbidden error:

What could be going wrong?
I am on a mac and I’m using dotnet core 5.0 in visual studio code.
The config seems to be setup right:

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (11 by maintainers)
Hi @mac2000 after some investigation, I believe it is a new bug. please see details and workaround there.