README.md 928 Bytes
Newer Older
Horst Gutmann's avatar
Horst Gutmann committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# KubeSelect

This is a little tool that allows you to select the KUBECTL
configuration and context that you want to work with right now. It
basically wraps the kubectl command.

## Usage

Select a kubeconfig file (stored inside ~/.kube) and a context within
each file:

```
$ eval $(kubeselect select)
```

On my own laptop I've added the following shell alias to make this a
bit more convenient:

```
$ alias ks='eval $(kubeselect select)'
```

Horst Gutmann's avatar
Horst Gutmann committed
23 24 25 26 27 28 29 30 31 32 33
To find out, what environment you've currently selected, run
`kubeselect status`:

```
$ kubeselect status
do-h10n.yaml // do-fra1-do-h10n
```

I've tried to compress the output as much as possible so that it can
also be used inside a shell prompt.

Horst Gutmann's avatar
Horst Gutmann committed
34 35 36 37 38 39 40 41
The `kubeselect run` command basically just wraps kubectl but uses the
specified environment variables for setting the `--context` flag.

Again, I've defined an alias to make my life easier:

```
$ alias k='kubeselect run -- '
```