Tmux plugin that displaying current Kubernetes context, cluster, namespace and user.
Status line with tmux-current-pane-hostname on the left side, tmux-kubectx and tmux-mode-indicator on the right side
Place defined variable in status-left
,status-right
or pane-border-format
:
#{kube_context}
will be the current context name, fetched bykubectl config current-context
#{kube_cluster}
will be the cluster name, defined in current context#{kube_namespace}
will be the namespace, defined in current context#{kube_user}
will be the user name, defined in current context
set -g status-right '#[bg=blue]#{kube_context}:#[bg=red]#{kube_namespace}#[default]'
With Tmux Plugin Manager (recommended)
Add plugin to the list of TPM plugins in .tmux.conf
:
set -g @plugin "tony-sol/tmux-kubectx"
Hit prefix + I
to fetch the plugin and source it.
Clone the repo:
$ git clone https://github.com/tony-sol/tmux-kubectx ~/clone/path
Add this line to the bottom of .tmux.conf
:
run-shell ~/clone/path/kubectx.tmux
Reload TMUX environment:
# type this in terminal
$ tmux source-file ~/.tmux.conf