Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple Kubeconfig files #75

Merged
merged 3 commits into from May 24, 2020

Conversation

ricoberger
Copy link
Member

@ricoberger ricoberger commented May 24, 2020

To support multiple Kubeconfig files we are adding two new flags: -kubeconfig-include and -kubeconfig-exclude. These flags can be used to provide paths were kubenav should look for Kubeconfig files.

When the -kubeconfig-include flag is provided the -kubeconfig and -sync flag is ignored, because the flags are used to provide an explicit path to a Kubeconfig file and we couldn't wrote the changes back to an explicit file.

Example:

# Load all config files from the ~/Documents/kubeconfig which starts with kubeconfig.
# Ignore all config files which contains the word dev.
kubenav -kubeconfig-include "~/.kube/config,~/Documents/kubeconfig/kubeconfig-*" -kubeconfig-exclude "~/Documents/kubeconfig/kubeconfig-*dev*"

Closes #52.

To support multiple Kubeconfig files we are adding two new flags:
"-kubeconfig-include" and "-kubeconfig-exclude". These flags can be used
to provide paths were kubenav should look for Kubeconfig files.

When the "-kubeconfig-include" flag is provided the "-kubeconfig" and
"-sync" flag is ignored, because the flags are used to provide an
explicit path to a Kubeconfig file and we couldn't wrote the changes
back to an explicit file.
@ricoberger ricoberger added the enhancement New feature or request label May 24, 2020
@ricoberger ricoberger merged commit 651d7b1 into master May 24, 2020
@ricoberger ricoberger deleted the support-multiple-kubeconfig-files branch May 24, 2020 18:41
@ricoberger ricoberger mentioned this pull request May 24, 2020
@ihsancemil
Copy link

@ricoberger when I use -kubeconfig with a conf file, it works perfectly. But when I try -kubeconfig-include with multiple conf file, I get "the server has asked for the client to provide credentials". Each configuration file define a users tag to connect cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error on macos
2 participants