Flux: `fluxctl` commands fail when using composite KUBECONFIG environment varible

Created on 20 Dec 2018  Â·  6Comments  Â·  Source: fluxcd/flux

Running fluxctl identity on WSL Ubuntu 16.04 with my KUBECONFIG environment variable set to concatenate several configs returned this error.

[☸ [email protected]:default] flux|masterâš¡ ⇒ fluxctl identity
Error: stat /home/lm/.kube/config:/home/lm/.kube/kube-config-mnd-k8s:/home/lm/.kube/kube-config-mnp-k8s:/home/lm/.kube/spray-config: no such file or directory
Run 'fluxctl identity --help' for usage.
bug

Most helpful comment

Done https://github.com/justinbarrick/go-k8s-portforward/pull/3

I will wait for the PR to be merged upstream to bump the dependency version

All 6 comments

This also causes the same error when running fluxctl sync.
Is there a work around for this or is flux unusable if you have to access more than one cluster?

one can run the command with a temporary env var like this:
KUBECONFIG=/home/lm/.kube/config fluxctl sync
But ideally the cli would respect the current kube context.

The Kubernetes port-forwarding library used by flux doesn't respect path lists in KUBECONFIG. I will look into upstreaming a fix for it or changing the port forwarder.

Done https://github.com/justinbarrick/go-k8s-portforward/pull/3

I will wait for the PR to be merged upstream to bump the dependency version

Thanks for the quick PR @2opremio!

No worries, hopefully @justinbarrick will have time to take a look soon 🤞

Was this page helpful?
0 / 5 - 0 ratings