What would you like to be added:
Currently, kai will use ~/.kube/config to connect to the cluster, even if the KUBECONFIG environment variable points to a different file. This makes it necessary to manually specify the -k $KUBECONFIG option when calling kai, creating the risk of inadvertently running kai against a different cluster than kubectl.
I would propose that kai should automatically use the kubeconfig file pointed to by the KUBECONFIG enviroment variable if it is set, otherwise attempt to use the current default of ~/.kube/config as a fallback to be consistent with other k8s tools.
Why is this needed:
Some users keep multiple separate kubeconfig files and switch between them by pointing the KUBECONFIG environment variable at the active config file. Kubectl and friends automatically pick up the active config from the environment, so having kai do the same would increase consistency and reduce the surprise factor for the user.
Additional context:
What would you like to be added:
Currently, kai will use
~/.kube/configto connect to the cluster, even if theKUBECONFIGenvironment variable points to a different file. This makes it necessary to manually specify the-k $KUBECONFIGoption when calling kai, creating the risk of inadvertently running kai against a different cluster than kubectl.I would propose that kai should automatically use the kubeconfig file pointed to by the
KUBECONFIGenviroment variable if it is set, otherwise attempt to use the current default of~/.kube/configas a fallback to be consistent with other k8s tools.Why is this needed:
Some users keep multiple separate kubeconfig files and switch between them by pointing the
KUBECONFIGenvironment variable at the active config file. Kubectl and friends automatically pick up the active config from the environment, so having kai do the same would increase consistency and reduce the surprise factor for the user.Additional context: