Comments (7)
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.
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.
:)
What you're looking for is:
KUBECONFIG=file1:file2 kubectl config view --minify > ~/.kube/config
from kubectx.
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.
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.
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.
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)
- Feature Request: Use kubectx to use right version of kubectl binary for a given K8s cluster HOT 1
- `kubens` fails with `invalid apiVersion "client.authentication.k8s.io/v1"` but `kubectl` works normally HOT 2
- Vulnerability of dependency "golang.org/x/net" HOT 1
- Add completions for Nushell
- Add kubectl plugin installation to Homebrew formula HOT 4
- [Go] kubens not working with in-cluster config HOT 1
- show all of NAME, CLUSTER and AUTHINFO in cluster selection list HOT 2
- Allow customizing path to KUBECTX and KUBENS_DIR
- Homebrew install makes kubectx slow HOT 6
- Shell completions (for zsh) fail for kubectx if its binary is renamed to kx HOT 1
- Autocomplete does not work when installed as Krew plugin HOT 2
- Autocomplete breaks when multiple longer contexts match HOT 2
- kubectl ctx outputs code lines start with plus sign + HOT 1
- error: open /home/myuser/.kube/config: permission denied HOT 1
- Consider open up internal packages HOT 2
- Very slow with large number of contexts HOT 3
- kubectx specific fzf options
- Feature-Request: Enable kubens to be used without cluster scope permissions HOT 1
- Go Toolchain Version Does Not Exist HOT 6
- Context switch is not working - possible clash with same context name value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubectx.