Skip to content

kube Segment

Description

This segment show kubernetes information of the form current-cluster:current-namespace as set in your kube config.

This segment is shown only when global variable KUBE_ENV exists and is not empty and kubernetes context can be retrive with kubectl command.

As I manage multiple kubernetes cluster depending on project, I set variables KUBE_ENV and KUBECONFIG by project using direnv.

To see how to use direnv for your folder, see section Using direnv to setup environment-variables

Requirements

This segment require the command kubectl to be in your PATH.

To install kubectl, see Install and Set Up kubectl.

Variables

Variables Default Description
KUBE_CHAR Character to show before the segment content
KUBE_FG white Foreground color of segment
KUBE_BG black Background color of segment, only used by v2

Examples

Prompt v1 Prompt v2
Full Version
kube v1 full
kube v2 full
Maximum Short Version
kube v1 short
kube v2 short


Last update: December 2, 2021
Back to top