You are tried many kubeconfig files
kc
command will help it easy to switch multiple kubeconfig file for you
How does it work? The script will scan your config file in ~/.kube/*.yaml and provide a bash shell autocompletion
Provide kc command switch kube config in ~/.kube/*.yaml
Usage: kc <file> | kc <press tab tab>
Installation
- Download kubeconfig.completion.bash
- Place the completion script in /etc/bash_completion.d/
- ReOpen your terminal or source this file
Sample output
thanh@thanh-pc:~$ kc /home/thanh/.kube/
/home/thanh/.kube/agim8.yaml /home/thanh/.kube/rke2-olive-ci.yaml
/home/thanh/.kube/olive-prod.yaml /home/thanh/.kube/rke2-ptthanh-i5-128-62-oidc.yaml
/home/thanh/.kube/ov.yaml /home/thanh/.kube/rke2-ptthanh-i5-128-62.yaml
/home/thanh/.kube/rke2-localhost.yaml /home/thanh/.kube/rke2-tdmu.yaml
/home/thanh/.kube/rke2-olive-ci-oidc.yaml /home/thanh/.kube/rke2-tma-45.yaml