Skip to content

Conversation

jbarrick-mesosphere
Copy link

Previously, in-cluster configuration could not be used because the
ExplicitPath was always set in the ClientConfigLoadingRules.

If ExplicitPath is not set, ClientConfigLoadingRules will look up
all of the standard environment variables to find the kubeconfig file,
including supporting in cluster authentication.

We leave the kubeconfig parameter on FromKubeConfig to support
explicitly setting the path and also to not change the signature.

This will fix docker/buildx#256 once the docker/cli dependency is
updated.

Signed-off-by: jbarrick@mesosphere.com jbarrick@mesosphere.com

- Description for the changelog

Added support for in-cluster Kubernetes authentication for Kubernetes contexts.

Previously, in-cluster configuration could not be used because the
ExplicitPath was always set in the `ClientConfigLoadingRules`.

If `ExplicitPath` is not set, `ClientConfigLoadingRules` will look up
all of the standard environment variables to find the kubeconfig file,
including supporting in cluster authentication.

We leave the `kubeconfig` parameter on `FromKubeConfig` to support
explicitly setting the path and also to not change the signature.

This will fix docker/buildx#256 once the docker/cli dependency is
updated.

Signed-off-by: jbarrick@mesosphere.com <jbarrick@mesosphere.com>
Signed-off-by: jbarrick@mesosphere.com <jbarrick@mesosphere.com>
Signed-off-by: jbarrick@mesosphere.com <jbarrick@mesosphere.com>
Copy link
Contributor

@simonferquel simonferquel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit to me

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki
Copy link
Contributor

Ping @mat007 do we want this PR for the next 20.0X release? If so we need to be sure it won't break desktop.

@AkihiroSuda
Copy link
Collaborator

PTAL @tonistiigi @thaJeztah

Seems needed for docker/buildx#256

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

Successfully merging this pull request may close these issues.

Support for in cluster kubernetes client
6 participants