cilium / cilium-cli

CLI to install, manage & troubleshoot Kubernetes clusters running Cilium
https://cilium.io
Apache License 2.0
416 stars 210 forks source link

Add a --kubeconfig argument #2723

Open kastl-ars opened 2 months ago

kastl-ars commented 2 months ago

Proposal

Many other tools including kubectl support specifying a kubeconfig file to be used when connecting to the cluster with a --kubeconfig`` flag or argument. So they work without having a~/.kube/configfile present (orKUBECONFIG` variable set to a file path).

If I am not mistaken, the cilium CLI does not support such an argument? Only a context can be given, from what I found.

As I am working with many different clusters, it would be nice if the cilium CLI supported such a flag. This makes switching between clusters a lot easier. Maybe others find that useful, too.

Kind Regards, Johannes

michi-covalent commented 1 month ago

hi @kastl-ars 👋 there is --context flag you can use to specify the kubectl context name returned from kubectl config get-contexts.

kastl-ars commented 1 month ago

hi @kastl-ars 👋 there is --context flag you can use to specify the kubectl context name returned from kubectl config get-contexts.

Thanks for the reply, Michi. But that only works if I have a kubeconfig in ~/.kube/config or the KUBECONFIG variable set.

Which is exactly what I would like to avoid by having a --kubeconfig flag...

michi-covalent commented 1 month ago

ah yeah that makes sense, sorry i didn't read you original description carefully 👍

kastl-ars commented 1 month ago

ah yeah that makes sense, sorry i didn't read you original description carefully 👍

No problem, always better to ask questions than to misunderstand something. :-)

ldlb9527 commented 1 month ago

If necessary, I have submitted a PR: Add a --kubeconfig argument