diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-05-08 20:40:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 20:40:36 +0200 |
commit | 0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534 (patch) | |
tree | 946d9f8b758ebdd63da96152ca56b154c99068da /plugins/kube-ps1/README.md | |
parent | afb028763cf40fc339e49011b2cba124dc108fcb (diff) | |
parent | ebc700be9b2fa7ae770a644093a5c46a8e323726 (diff) | |
download | zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.gz zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.bz2 zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.zip |
Merge branch 'master' into master
Diffstat (limited to 'plugins/kube-ps1/README.md')
-rw-r--r-- | plugins/kube-ps1/README.md | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md index a572773a3..19dac42e9 100644 --- a/plugins/kube-ps1/README.md +++ b/plugins/kube-ps1/README.md @@ -1,13 +1,12 @@ -Kubernetes prompt for zsh -========================= +# Kubernetes prompt for zsh -A Kubernetes (k8s) zsh prompt that displays the current cluster cluster +A Kubernetes zsh prompt that displays the current cluster cluster and the namespace. Inspired by several tools used to simplify usage of kubectl -NOTE: If you are not using zsh, check out [kube-ps1](https://github.com/jonmosco/kube-ps1) designed for bash -as well as zsh. +NOTE: If you are not using zsh, check out [kube-ps1](https://github.com/jonmosco/kube-ps1) +designed for bash as well as zsh. ## Requirements @@ -32,29 +31,51 @@ fast switching between clusters and namespaces. The prompt layout is: ``` -(<logo>|<cluster>:<namespace>) +(<symbol>|<cluster>:<namespace>) ``` -Supported platforms: -* k8s - Kubernetes -* ocp - OpenShift +## Enabling -## Install +In order to use kube-ps1 with Oh My Zsh, you'll need to enable them in the +.zshrc file. You'll find the zshrc file in your $HOME directory. Open it with +your favorite text editor and you'll see a spot to list all the plugins you +want to load. -1. Clone this repository -2. Source the kube-ps1.zsh in your ~./.zshrc +```shell +vim $HOME/.zshrc +``` + +Add kube-ps1 to the list of enabled plugins and enable it on the prompt: + +```shell +plugins=( + git + kube-ps1 +) -ZSH: +PROMPT=$PROMPT'$(kube_ps1) ' ``` -source path/kube-ps1.sh -PROMPT='$(kube_ps1) ' + +Note: the `PROMPT` example above was tested with the theme `robbyrussell` + +## Enabling / Disabling on the current shell + +Sometimes the kubernetes information can be anoying, you can easily +switch it on and off with the following commands: + +```shell +kubeon +``` + +```shell +kubeoff ``` ## Colors -The colors are of my opinion. Blue was used as the prefix to match the Kubernetes -color as closely as possible. Red was chosen as the cluster name to stand out, and cyan -for the namespace. These can of course be changed. +Blue was used as the prefix to match the Kubernetes color as closely as +possible. Red was chosen as the cluster name to stand out, and cyan +for the namespace. Check the customization section for changing them. ## Customization @@ -62,15 +83,21 @@ The default settings can be overridden in ~/.zshrc | Variable | Default | Meaning | | :------- | :-----: | ------- | -| `KUBE_PS1_DEFAULT` | `true` | Default settings for the prompt | +| `KUBE_PS1_BINARY` | `kubectl` | Default Kubernetes binary | | `KUBE_PS1_PREFIX` | `(` | Prompt opening character | -| `KUBE_PS1_DEFAULT_LABEL` | `⎈ ` | Default prompt symbol | +| `KUBE_PS1_SYMBOL_ENABLE` | `true ` | Display the prompt Symbol. If set to `false`, this will also disable `KUBE_PS1_SEPARATOR` | +| `KUBE_PS1_SYMBOL_DEFAULT` | `⎈ ` | Default prompt symbol. Unicode `\u2388` | +| `KUBE_PS1_SYMBOL_USE_IMG` | `false` | ☸️ , Unicode `\u2638` as the prompt symbol | +| `KUBE_PS1_NS_ENABLE` | `true` | Display the namespace. If set to `false`, this will also disable `KUBE_PS1_DIVIDER` | | `KUBE_PS1_SEPERATOR` | `\|` | Separator between symbol and cluster name | -| `KUBE_PS1_PLATFORM` | `kubectl` | Cluster type and binary to use | | `KUBE_PS1_DIVIDER` | `:` | Separator between cluster and namespace | | `KUBE_PS1_SUFFIX` | `)` | Prompt closing character | -| `KUBE_PS1_DEFAULT_LABEL_IMG` | `false` | Use Kubernetes img as the label: ☸️ | +| `KUBE_PS1_COLOR_SYMBOL` | `"%F{blue}"` | Custom color for the symbol | +| `KUBE_PS1_COLOR_CONTEXT` | `"%F{red}"` | Custom color for the context | +| `KUBE_PS1_COLOR_NS` | `"%F{cyan}"` | Custom color for the namespace | +| `KUBE_PS1_ENABLED` | `true` | Set to false to start disabled on any new shell, `kubeon`/`kubeoff` will flip this value on the current shell | ## Contributors -Jared Yanovich +- Jared Yanovich +- Pedro Moranga
\ No newline at end of file |