Note: Hi! This plugin is not actively maintained at the moment, please check this repository out if you're looking for a similar project: https://github.com/jonmosco/kube-tmux /Mikael
This tmux
plugin displays your kubectl
context status information in the status bar.
Example:
From the official Kubernetes documentation:
A context element in a kubeconfig file is used to group access parameters under a convenient name. Each context has three parameters: cluster, namespace, and user. By default, the kubectl command-line tool uses parameters from the current context to communicate with the cluster.
Add #{k8s_status}
to your status-left
or status-right
:
Example:
set -g status-right '#{k8s_status} %a %Y-%m-%d %H:%M'
The information in the status bar will be presented in the following way:
<context>:<cluster>:<namespace>(<number of pods>)
- Install Tmux Plugin Manager.
- Add this plugin to your
~/.tmux.conf
:
set -g @plugin 'mikejoh/tmux-k8s'
- Press [prefix] +
I
to install.
- Create the tmux plugin directory and clone this repository:
mkdir -p ~/.tmux/plugins && git clone https://github.com/mikejoh/tmux-k8s.git ~/.tmux/plugins/tmux-k8s
- Press [prefix] +
I
to install.
If you want to use my status bar setup in tmux, or basically use my tmux.conf as is, you can find more info here.