Command kube-tmux prints Kubernetes context and namespace to tmux status line.

kube-tmux

Command kube-tmux prints Kubernetes context and namespace to tmux status line.

Usage

$ kube-tmux -h
Usage of kube-tmux:
  -ctxBg string
        Context background colour
  -ctxFg string
        Context foreground colour
  -nsBg string
        Namespace background colour
  -nsFg string
        Namespace foreground colour
  -sepBg string
        Separator background colour
  -sepFg string
        Separator foreground colour
  -separator string
        Separator of Context and Namespace (default "/")

I’m using the follows:

set -g status-right "#(kube-tmux -separator=':' -ctxFg='colour011#,bright' -ctxBg 'default' -sepFg 'colour015#,bright' -nsFg 'colour075#,bright')"

Benchmark

Benchmark command:

$ kube.tmux
#[fg=blue]⎈ #[fg=colour]#[fg=]gke_asia-northeast1_cluster#[fg=colour250]:#[fg=]kube-system

$ kube-tmux -separator=':' -ctxFg='blue' -sepFg 'colour250' -nsFg 'default'
#[fg=blue]gke_asia-northeast1_cluster#[fg=colour250]:#[fg=default]kube-system#[fg=default#,bg=default]

Note

  • go version
    • go version devel go1.17-543e098320 Wed May 5 19:17:46 2021 +0000 X:staticlockranking darwin/amd64
  • tmux default-shell is /bin/sh.
  • On darwin, echo 3 > /proc/sys/vm/drop_caches similar command is sync && sudo purge

Result

$ hyperfine --shell /bin/sh --prepare 'sync && sudo purge' --max-runs 10 --warmup 3 'kube.tmux'
Benchmark #1: kube.tmux
  Time (mean ± σ):     275.2 ms ±  54.0 ms    [User: 111.2 ms, System: 74.3 ms]
  Range (min … max):   224.3 ms … 368.1 ms    10 runs

$ hyperfine --shell /bin/sh --prepare 'sync && sudo purge' --max-runs 10 --warmup 3 "kube-tmux -separator=':' -ctxFg='blue' -sepFg 'colour250' -nsFg 'default'"
Benchmark #1: kube-tmux -separator=':' -ctxFg='blue' -sepFg 'colour250' -nsFg 'default'
  Time (mean ± σ):     102.2 ms ±  64.6 ms    [User: 8.0 ms, System: 35.6 ms]
  Range (min … max):    12.5 ms … 178.0 ms    10 runs
Command Mean [ms] Min [ms] Max [ms] Relative
kube.tmux 290.2 ± 62.9 223.6 382.2 1.00
kube-tmux -separator=':' -ctxFg='blue' -sepFg 'colour250' -nsFg 'default' 84.2 ± 59.6 15.9 156.5 1.00
Similar Resources

Container image sweeper kube

container-image-sweeper-kube container-image-sweeper-kube は、不要になった Docker イメージを自

Jan 24, 2022

Kube-step-podautoscaler - Controller to scale workloads based on steps

Kube-step-podautoscaler - Controller to scale workloads based on steps

Refer controller/*controller.go for implementation details and explanation for a better understanding.

Sep 5, 2022

A fake kube-apiserver that serves static data from files

Static KAS A fake kube-apiserver that serves static data from an Openshift must-gather. Dynamically discovers resources and supports logs. Requires go

Nov 19, 2022

Quick find namespace and show log

kubernetes dashboard "替代品" 在terminal发起http请求查看kubernetes相关的信息 注意 本程序以查看当前namespace、deployment、pod等信息为主, 面向业务开发人员,主要原因是权限受限。如果是运维人员绕行即可 当前只是使用与token登录方

Dec 23, 2021

To copy a secret to another namespace and sync it up-to-date

Secret Mirror Operator This kubebuilder-based Kubernetes operator copies a Secret to another namespace and synchronizes it with the custom resource Se

Jul 20, 2022

Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users.

Quota Operator Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users. Instructi

Nov 9, 2022

Go-namesys - Go-namesys provides publish and resolution support for the /ipns/ namespace

go-namesys go-namesys provides publish and resolution support for the /ipns/ nam

Jan 18, 2022

A kubectl plugin to query multiple namespace at the same time.

kubemulti A kubectl plugin to query multiple namespace at the same time. $ kubemulti get pods -n cdi -n default NAMESPACE NAME

Mar 1, 2022

Display (Namespace, Pod, Container, Primary PID) from a host PID, fails if the target process is running on host

Display (Namespace, Pod, Container, Primary PID) from a host PID, fails if the target process is running on host

Oct 17, 2022
Kubesecret is a command-line tool that prints secrets and configmaps data of a kubernetes cluster.

Kubesecret Kubesecret is a command-line tool that prints secrets and configmaps data of a kubernetes cluster. kubesecret -h for help pages. Install go

May 3, 2022
vcluster - Create fully functional virtual Kubernetes clusters - Each cluster runs inside a Kubernetes namespace and can be started within seconds
vcluster - Create fully functional virtual Kubernetes clusters - Each cluster runs inside a Kubernetes namespace and can be started within seconds

Website • Quickstart • Documentation • Blog • Twitter • Slack vcluster - Virtual Clusters For Kubernetes Lightweight & Low-Overhead - Based on k3s, bu

Jan 4, 2023
Kube - A simple Kubernetes client, based on client-go

kube A simple Kubernetes client, based on client-go.

Aug 9, 2022
Good enough Kubernetes namespace visualization tool
Good enough Kubernetes namespace visualization tool

Kubesurveyor Good enough Kubernetes namespace visualization tool. No provisioning to a cluster required, only Kubernetes API is scrapped. Installation

Dec 7, 2022
K8s-ingress-health-bot - A K8s Ingress Health Bot is a lightweight application to check the health of the ingress endpoints for a given kubernetes namespace.

k8s-ingress-health-bot A K8s Ingress Health Bot is a lightweight application to check the health of qualified ingress endpoints for a given kubernetes

Jan 2, 2022
Kubernetes Admission Controller Demo: Validating Webhook for Namespace lifecycle events

Kubernetes Admission Controller Based on How to build a Kubernetes Webhook | Admission controllers Local Kuberbetes cluster # create kubernetes cluste

Feb 27, 2022
A controller managing namespaces deployments, statefulsets and cronjobs objects. Inspired by kube-downscaler.

kube-ns-suspender Kubernetes controller managing namespaces life cycle. kube-ns-suspender Goal Usage Internals The watcher The suspender Flags Resourc

Dec 27, 2022
A general purpose cloud provider for Kube-Vip

kube-vip-cloud-provider The Kube-Vip cloud provider is a general purpose cloud-provider for on-prem bare-metal or virtualised environments. It's desig

Jan 8, 2023
Reworking kube-proxy's architecture

Kubernetes Proxy NG The Kubernetes Proxy NG a new design of kube-proxy aimed at allowing Kubernetes business logic to evolve with minimal to no impact

Jan 3, 2023
scenario system to check the behavior of kube-scheduler

kube-scheduler-simulator-cli: Kubernetes Scheduler simulator on CLI and scenario system. Hello world. This repository is scenario system for kube-sche

Jan 25, 2022