]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/kubectx/README.md
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / kubectx / README.md
1 # kubectx - show active kubectl context
2
3 This plugins adds ```kubectx_prompt_info()``` function. It shows name of the
4 active kubectl context (```kubectl config current-context```).
5
6 You can use it to customize prompt and know if You are on prod cluster ;)
7
8 _Example_. Add to **.zshrc**:
9
10 ```
11 RPS1='$(kubectx_prompt_info)'
12 ```
13
14 ### custom ctx names
15
16 One can rename default context name for better readability.
17
18 _Example_. Add to **.zshrc**:
19 ```
20 kubectx_mapping[minikube]="mini"
21 kubectx_mapping[context_name_from_kubeconfig]="$emoji[wolf_face]"
22 kubectx_mapping[production_cluster]="%{$fg[yellow]%}prod!%{$reset_color%}"
23 ```
24
25 ![staging](stage.png)
26 ![production](prod.png)