kubetail icon indicating copy to clipboard operation
kubetail copied to clipboard

Not able to switch between kubeconfigs

Open daki88 opened this issue 5 years ago • 4 comments

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

daki88 avatar Mar 11 '19 11:03 daki88

Maybe you could help out and add support for it?

johanhaleby avatar Mar 30 '19 12:03 johanhaleby

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

daki88 avatar Apr 01 '19 08:04 daki88

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

unstppbl avatar Apr 09 '20 11:04 unstppbl