GithubHelp home page GithubHelp logo

Comments (6)

alexdyas avatar alexdyas commented on May 29, 2024 1

Hi, sorry I missed this being closed. Just tried it, works perfectly, thanks!

from kubeswitch.

danielfoehrKn avatar danielfoehrKn commented on May 29, 2024

Am I doing something wrong?

No, it is just not supported yet. But it does not sound very complicated.
I'll try to add it, but cannot give you a concrete timeline :)

from kubeswitch.

alexdyas avatar alexdyas commented on May 29, 2024

I'm a bit confused in that case. For kubectl to work with multiple kubeconfig files I have to set the KUBECONFIG environment variable using the colon separated list of config files, otherwise it doesn't see any config. However for kubeswitch to work I have to unset the KUBECONFIG variable, and instead set the wildcard in switch-config.yaml. I don't understand how both kubectl and kubeswitch could both work if I want multiple config files.

from kubeswitch.

danielfoehrKn avatar danielfoehrKn commented on May 29, 2024

Currently kubeswitch does not work with multiple paths in the KUBECONFIG. It will always try to load whatever is configured in the environment variable and throws an error.

As soon as kubeswitch supports it the flow will look like this:

  • KUBECONFIG env variable has multiple paths
  • kubeswitch displays contexts from multiple paths + what is configured in the switch-config.yaml
  • User selects a context
  • kubeswitch creates a temporary kubeconfig file containing only your selected context.
  • the KUBECONFIG env variable is updated to point to the temporary kubeconfig.
  • kubectl works against one context in one kubeconfig file. If you want to switch contexts, you need to use switch again. You need to have both the kubeconfig files in the switch-config.yaml, otherwise you cannot select them as they are not in the KUBECONFIG env variable any more.

As an alternative: Do not set multiple paths in the KUBECONFIG env variable. Set multiple paths in the switch.config file like shown in the docs.

Does that help?

from kubeswitch.

alexdyas avatar alexdyas commented on May 29, 2024

Yes that makes sense I think. Thanks for the feedback.

from kubeswitch.

danielfoehrKn avatar danielfoehrKn commented on May 29, 2024

I created this commit included in the release 0.4.8 so you can try it out.

If it does not work for you, feel free to open the issue again.

from kubeswitch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.