Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kn fails when KUBECONFIG multi config files #196

Closed
csantanapr opened this issue Jun 21, 2019 · 6 comments · Fixed by #222
Closed

kn fails when KUBECONFIG multi config files #196

csantanapr opened this issue Jun 21, 2019 · 6 comments · Fixed by #222
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@csantanapr
Copy link
Member

kn doesn't support when the env variable KUBECONFIG has multiple files

As reference: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#append-home-kube-config-to-your-kubeconfig-environment-variable

For example in my setup I use IKS and have multiple cluster I deal with, so I load KUBECONFIG variable with multiple KUBECONFIG paths including the default one.

echo $KUBECONFIG

value:

/Users/csantanapr/.kube/config:/Users/csantanapr/.bluemix/plugins/container-service/clusters/cluster1/kube-config-wdc04-cluster1.yml:/Users/csantanapr/.bluemix/plugins/container-service/clusters/cluster2/kube-config-dal13-cluster2.yml

This allows to use things like kubetcx

$ kubectx
cluster1
cluster2
docker-desktop

The CLI kubectl works fine current context is cluster1

kubectl get ns | grep knative
knative-build        Active   98m
knative-eventing     Active   98m
knative-monitoring   Active   98m
knative-serving      Active   98m
knative-sources      Active   98m

The problem is kn doesn't work and recognize the current context from the merged files like kubectl

kn service list              
stat /Users/csantanapr/.kube/config:/Users/csantanapr/.bluemix/plugins/container-service/clusters/cluster1/kube-config-wdc04-cluster1.yml:/Users/csantanapr/.bluemix/plugins/container-service/clusters/cluster2/kube-config-dal13-cluster2.yml: no such file or directory
@csantanapr csantanapr added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2019
@navidshaikh
Copy link
Collaborator

This should be fixed by PR #36.

@csantanapr
Copy link
Member Author

@navidshaikh

But PR #36 has no activity since 3 months ago and it’s closed 🤷🏻‍♂️

@navidshaikh
Copy link
Collaborator

@csantanapr
My bad, selected wrong PR from dropdown, this is correct one #172

@csantanapr
Copy link
Member Author

Thank you 🙏🏻

@edwardstudy
Copy link
Contributor

Still didn't work if:

$ ./kn service list --kubeconfig=$KUBECONFIG
stat /Users/bjxzi/.kube/config:/Users/bjxzi/.bluemix/plugins/container-service/clusters/eirini/kube-config-dal10-eirini.yml:/Users/bjxzi/.bluemix/plugins/container-service/clusters/knative/kube-config-dal10-knative.yml:/Users/bjxzi/.bluemix/plugins/container-service/clusters/mycluster/kube-config-dal10-mycluster.yml:/Users/bjxzi/.bluemix/plugins/container-service/clusters/eirini-deploy/kube-config-dal10-eirini-deploy.yml:/Users/bjxzi/.bluemix/plugins/container-service/clusters/knative-deploy/kube-config-dal10-knative-deploy.yml: no such file or directory

@maximilien
Copy link
Contributor

/assign @edwardstudy

@sixolet sixolet added this to the v0.8.0 milestone Jul 9, 2019
coryrc pushed a commit to coryrc/client that referenced this issue May 14, 2020
* Separate gcs and testgrid into its own packages

* Return string instead of fields array in checkLog

* Address review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants