Code Monkey home page Code Monkey logo

kx's Introduction

kx

Changes KUBECONFIG environment variable in the current shell

Installation

You can either download compiled binary from releases to a directory in you $PATH or compile it yourself by cargo install k8s-kx. Binaries in releases are build using musl toolchain, therefore they have no external dependencies (not even libc).

Add the following to your .bashrc

kx() {
    eval $(k8s-kx)
}

Usage

$ kx

Configuration

  • $KX_SEARCH_DIR will let you choose KUBECONFIG from this directory
  • $KX_CONFIG_PATH will read configuration from this file (format below)
  • $XDG_CONFIG_HOME/kx/config.json
  • ~/.config/kx/config.json
  • if none of them are found, will search for kubeconfigs in ~/.kube

Config file format

{
    "search_dir": [
        // absolute path
        "/path/to/dir/with/cubeconfigs",
        // will be resolved relative to $PWD
        "path/to/cubeconfigs", 
        // will be resolved relative to this config file
        "./path/to/cubeconfigs",
        // will be resolved relative to home directory
        "~/path/to/cubeconfigs",
        // will try to find first existing directory:
        //   $PWD/path/to/cubeconfigs
        //   $PWD/../path/to/cubeconfigs
        //   $PWD/../../path/to/cubeconfigs
        //   ...
        //   /path/to/cubeconfigs
        "^path/to/cubeconfigs",
    ]
}

kx's People

Contributors

jsen- avatar etharendil avatar ermitovski avatar

Watchers

James Cloos 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.