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: Screen Shot 2021-05-29 at 1 19 58 PM

And I can use kubectl without any errors: Screen Shot 2021-05-29 at 1 21 12 PM

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: Screen Shot 2021-05-29 at 1 17 00 PM

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: Screen Shot 2021-05-29 at 1 24 25 PM

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

Hi @mac2000 after some investigation, I believe it is a new bug. please see details and workaround there.