databricks / click

The "Command Line Interactive Controller for Kubernetes"
Apache License 2.0
1.49k stars 84 forks source link

Does not work when ${KUBECONFIG} is not name `config` #30

Closed code-noggin closed 6 years ago

code-noggin commented 6 years ago

This is a great concept and I really appreciate you creating it. Unfortunately I can't get it to work with kubernetes clusters hosted by IBM Cloud.

Current Behavior

$ echo ${KUBECONFIG}
/Users/code-noggin/.bluemix/plugins/container-service/clusters/mycluster/kube-config-hou02-mycluster.yml

$ kubectl config current-context
mycluster

$ click
Could not open config file at '/Users/code-noggin/.kube/click.config': No such file or directory (os error 2). Using default values
Could not load kubernetes config: '/Users/code-noggin/.kube/config'. Cannot continue.  Error was: entity not found

$ click -c $(dirname ${KUBECONFIG})
Could not open config file at '/Users/code-noggin/.bluemix/plugins/container-service/clusters/mycluster/click.config': No such file or directory (os error 2). Using default values
Could not load kubernetes config: '/Users/code-noggin/.bluemix/plugins/container-service/clusters/mycluster/config'. Cannot continue.  Error was: entity not found

Expected Behavior

click uses the value of ${KUBECONFIG} environment variable to read contexts, etc.

adamdecaf commented 6 years ago

Ran into this also. With CoreOS tectonic.

$ ls -1 ~/.kube/
kube-config-k8s-banno-production
elblivion commented 6 years ago

Also does not support colon-separated file lists defined in $KUBECONFIG.

https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable

nicklan commented 6 years ago

As of #28 we use $KUBECONFIG. I'm closing this, but as @elblivion noted, we don't support having multiple files in there. I've added a new issue to track that support here #49