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

Not able to switch between kubeconfigs #83

Open
daki88 opened this issue Mar 11, 2019 · 3 comments
Open

Not able to switch between kubeconfigs #83

daki88 opened this issue Mar 11, 2019 · 3 comments

Comments

@daki88
Copy link

daki88 commented Mar 11, 2019

Seems like there is no option to choose different kubeconfig, which can be useful when working with multiple clusters in different kubeconfigs

@johanhaleby
Copy link
Owner

Maybe you could help out and add support for it?

@daki88
Copy link
Author

daki88 commented Apr 1, 2019

Not sure if my knowledge is wide enough to create support for this...

dougsparling pushed a commit to dougsparling/kubetail that referenced this issue Apr 10, 2019
dougsparling pushed a commit to dougsparling/kubetail that referenced this issue Apr 10, 2019
@unstppbl
Copy link

unstppbl commented Apr 9, 2020

There is a -t, --context option for this.

Gather all your different Kube-conf files in a folder. And export these files separated by a colon. Also, you can add to your ~/.bash_profile file.

export KUBECONFIG=/home/user/.kube/config1:/home/user/.kube/config2:/home/user/.kube/config3

To get context names: kubectl config get-contexts

Then just use kubetail with -t option:

kubetail some-pod-name -t cluster1 -n prod -s 10m

For more instruction on using several context:
https://myopswork.com/how-to-switch-b-w-multiple-kubernetes-clusters-1feaf80e0cbe

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

No branches or pull requests

3 participants