Skip to content

No Access Token when running inside cluster? #862

Description

@HenrikDK

Hi

I'm using the C# client to fetch information from api server.

I decided to only partially use the client library to fetch "access token" that you need to attach as a bearer when making api requests.

While the approach worked fine while testing locally all requests started failing when the pod ran inside the cluster.

I added some logging so I could see what's happening inside the cluster:

if (KubernetesClientConfiguration.IsInCluster()){
    Log.Logger.Information($"Controller running in cluster with host \"{config.Host}\" using access token \"{config.AccessToken}\"");
    Log.Logger.Information(JsonConvert.SerializeObject(config));
}

When I run my pod inside a cluster the access token property is empty. And I get following message:

{"Timestamp":"2022-05-27T11:05:38.3458927+00:00","Level":"Information","MessageTemplate":"Controller running in cluster with host \"https://172.18.0.1:443/\" using access token \"\""}

Does the client use some other authentication method when running inside the cluster?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions