Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.42 KB

README.md

File metadata and controls

53 lines (35 loc) · 1.42 KB

Tmux Kubernetes Context

Tmux plugin that displaying current Kubernetes context, cluster, namespace and user.

status-line Status line with tmux-current-pane-hostname on the left side, tmux-kubectx and tmux-mode-indicator on the right side

Usage

Place defined variable in status-left,status-right or pane-border-format:

  • #{kube_context} will be the current context name, fetched by kubectl 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

Example

set -g status-right '#[bg=blue]#{kube_context}:#[bg=red]#{kube_namespace}#[default]'

Installation

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.

Manual

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