|
1 | 1 | # kubeconfig-manager |
2 | 2 |
|
3 | | -## TODO |
4 | | - |
5 | | -1. Add a proper readme |
6 | | -2. Add kubeconfig download from |
7 | | - * AWS |
8 | | - * Azure |
9 | | - * Alibaba |
10 | | - * GCP |
11 | | - * God only knows... |
12 | | -3. Proper versioning |
13 | | -4. Proper Releases |
14 | | -5. Badges |
15 | | -6. Screenshots |
| 3 | +[](https://sonarcloud.io/dashboard?id=kalgurn_kubeconfig-manager) |
| 4 | +[](https://sonarcloud.io/dashboard?id=kalgurn_kubeconfig-manager) |
| 5 | + |
| 6 | +## Download |
| 7 | + |
| 8 | +To start your experience with a kubeconfig-manager you need to download desired version from the [releases page](https://github.com/kalgurn/kubeconfig-manager/releases). |
| 9 | +After you've downloaded a package, you can rename it to something you will be comfortable with and move to your /bin folder, e.g. |
| 10 | + |
| 11 | +```bash |
| 12 | +mv kubeconfig-manager-darwin-amd64 /usr/bin/kcmanager |
| 13 | +``` |
| 14 | + |
| 15 | +You are now ready to go |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +By default _kubeconig-manager_ will use a config defined in a __KUBECONFIG__ environment variable. If there is none, it will use the one from the user home dir, e.g. _~/.kube/config_. |
| 20 | + |
| 21 | +```bash |
| 22 | +kcmanager list - Lists all of the current contextes |
| 23 | +kcmanager ctx context_name - Switch to a context context_name |
| 24 | +kcmanager export context_name - Export one context from your configuration as a separate kubeconfig with user and server configuration. It will be named as a context_name.yaml |
| 25 | +kcmanager delete context_name - Delete context_name context and related user/server |
| 26 | +kcmanager add - will be described below |
| 27 | +``` |
| 28 | + |
| 29 | +### _kcmanager add_ options |
| 30 | + |
| 31 | +By default, if not specified with a flag the bahaviour of kcmanager is next: |
| 32 | + |
| 33 | +```bash |
| 34 | +kcmanager add context_name.yaml - will add all of the contexts and related user/server configurations to your kubeconfig |
| 35 | +``` |
| 36 | + |
| 37 | +Currently implemented flags |
| 38 | + |
| 39 | +- _--rancher_ |
| 40 | +This flag requires additional enviroenmtn variable RANCHER_TOKEN to be set. This allows to download a kubeconfig for a specific cluster listed in your rancher installation and then add it to your current configuration. Example usage: |
| 41 | + |
| 42 | +```bash |
| 43 | +export RANCHER_TOKEN=token-xxxxx:xxxxxxxxxxxxxxxxxxxxxxxxx |
| 44 | +kcmanager add --rancher RANCHER_URL CLUSTER_NAME |
| 45 | +``` |
0 commit comments