Git Product home page Git Product logo

Comments (7)

fkrauthan avatar fkrauthan commented on September 2, 2024 2

Oh cool didn't know that exist. I still think a shortcut method like kubectx import ./file1 would be more preferable (given that everything this util does exist anyways except shorter and more easy accessible)

from kubectx.

ahmetb avatar ahmetb commented on September 2, 2024 1

I just don't think it's a super common operation that people do out there. But if this comes up from other people, I'll be open to doing it. I'm trying to keep feature creep out and keep the tool focused.

from kubectx.

ahmetb avatar ahmetb commented on September 2, 2024

:)

What you're looking for is:

KUBECONFIG=file1:file2 kubectl config view --minify > ~/.kube/config

from kubectx.

fkrauthan avatar fkrauthan commented on September 2, 2024

Hmm I just tested your solution and successful destroyed my kubeconfig file (thats on me). But unfortunately specifying multiple kubeconfig files in KUBECONFIG and using config view redacts certificate information which renders the result not usable.

from kubectx.

ahmetb avatar ahmetb commented on September 2, 2024

specifying multiple kubeconfig files in KUBECONFIG and using config view redacts certificate information

This is my bad. :) I should've told you to use kubectl config view --merge --flatten. This preserves both cluster certficate-authority-data and user client-{certificate,key}-data fields. (see kubemci repo for example usages of this).

from kubectx.

naphta avatar naphta commented on September 2, 2024

It would be a pretty useful thing to have as theres one specific use case which the above example doesn't cater to; if you're importing a configuration where one of the fields has the same name but different values; e.g. same username different token / ca.

For me it's handy since I'm regularly connecting to 10+ kubernetes clusters and many of them cycle credentials for access.

I think it'd make more sense for it to be a different script though; kubecfg for example? The only challenge I can see which needs overcoming is parsing the YAML to ensure none of the names collide; and if they do ask the user what needs to happen.

$ kubecfg add <path>
$ kubecfg update <name> <path>

orΒ Β 

$ kubectx -n <path>
$ kubectx -u <name>=<path>

from kubectx.

ahmetb avatar ahmetb commented on September 2, 2024

We have some kubectl plugins in Krew (http://krew.dev) already doing this, and there are even desktop tools like https://github.com/turkenh/KubeContext/blob/master/README.md#installation that do similar things.

from kubectx.

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.