Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Add KubeConfig.from_env_var or similar #139

Open
exarkun opened this issue Sep 14, 2017 · 0 comments
Open

Add KubeConfig.from_env_var or similar #139

exarkun opened this issue Sep 14, 2017 · 0 comments

Comments

@exarkun
Copy link

exarkun commented Sep 14, 2017

kubectl respects KUBECONFIG for its configuration file location. In addition to the obvious, it also supports multiple configuration files in this variable and merges them.

See https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#the-kubeconfig-environment-variable for details

It would be great to have a simple API for creating a KubeConfig obeying this convention. For example:

KubeConfig.from_kubeconfig_env(os.environ['KUBECONFIG'])

which might be a building block of a future API like:

KubeConfig.from_convention(os.environ)

(which would look for KUBECONFIG in the given environ dict and then fall back to $HOME/.kube/config if the var is not present)

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

No branches or pull requests

1 participant