Skip to content

kn fails when KUBECONFIG multi config files #196

@csantanapr

Description

@csantanapr

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

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions