Giter Club home page Giter Club logo

konfig's Introduction

konfig

Latest GitHub release GitHub workflow status Written in Bash

konfig helps to merge, split or import kubeconfig files

Usage

Import a kubeconfig

konfig import --save new-cfg

Imports the config file new-cfg into the default kubeconfig at ~/.kube/config. To show the result without changing your kubeconfig, do

konfig import new-cfg

CAVEAT: due to how shells work, the following will lose your current ~/.kube/config

# WRONG, don't do this!
konfig import new-cfg > ~/.kube/config

Merge several kubeconfig files

konfig merge config1 config2 > merged-config

This variant creates a self-contained kubeconfig where all credentials are stored inline in the kubeconfig. If you want to preserve the structure and keep credentials separate, use --preserve-structure.

Extract a minimal kubeconfig for one or several contexts

This will extract a minimal kubeconfig with a single context minikube:

# extract context minikube from the default kubeconfig
konfig export minikube > minikube.config

# extract context minikube and docker-for-desktop from two input configs
konfig export minikube docker-for-desktop -k ~/.kube/other,~/dockercfg > local

Installation

There are several ways to install konfig. The recommended installation method is via krew.

Via krew

Krew is the kubectl plugin manager. If you have not yet installed krew, get it at https://github.com/kubernetes-sigs/krew. Then installation is as simple as

kubectl krew install konfig

The plugin will be available as kubectl konfig, see doc/USAGE for further details. You could also define an alias as well: alias konfig = 'kubectl konfig'

Manual

When using the binaries for installation, also have a look at USAGE.

OSX & Linux

curl -Lo konfig https://github.com/corneliusweig/konfig/raw/v0.2.6/konfig \
  && chmod +x konfig \
  && sudo mv -i konfig /usr/local/bin

Feel free to change the sudo mv to put konfig in some other location from your $PATH variable.

Windows

If you figure out how to run konfig on Windows, please send a PR with instructions.

konfig's People

Contributors

corneliusweig avatar keisukeyamashita avatar limonkufu avatar mcristina422 avatar rabattkarte avatar rajatjindal avatar stb1337 avatar yujunz avatar

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.