You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
The text was updated successfully, but these errors were encountered:
The environment variable to set the kubeconfig path should take precedence, but want to make sure we're setting the right one. In order for KAI to prefer a different path besides the home directory's kubeconfig, it looks in the following places:
kai.yaml direct kube config (i.e. translating the actual kubeconfig into the kai.yaml file)
~.kube/config
So, as you mentioned, kai is not respecting the KUBECONFIG env var directly, but it would respect KAI_KUBECONFIG_PATH. It seems that you're suggesting that the KUBECONFIG env var is used more commonly by k8s operators and that we should interpret that as well. Perhaps we could add it between options 3 and 4 above in terms of order of precedence? Would that satisfy the feature request as it's laid out in your comment?
What would you like to be added:
Currently, kai will use
~/.kube/config
to connect to the cluster, even if theKUBECONFIG
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:
The text was updated successfully, but these errors were encountered: