| Crates.io | k8s-kx |
| lib.rs | k8s-kx |
| version | 0.3.0 |
| created_at | 2019-09-19 23:43:33.192656+00 |
| updated_at | 2019-09-24 21:00:03.409177+00 |
| description | set KUBECONFIG environment variable for current shell session |
| homepage | |
| repository | https://github.com/jsen-/kx |
| max_upload_size | |
| id | 166100 |
| size | 145,060 |
Changes KUBECONFIG environment variable in the current shell

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
alias kx='source <("k8s-kx")'
$ kx
$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~/.kube{
"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",
]
}