Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add k8s segment to show context and namespace info #545

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

3coma3
Copy link

@3coma3 3coma3 commented Jul 15, 2023

Hi, I added this segment to avoid making mistakes when using multiple k8s contexts/namespaces.

Hope you find it useful, any corrections welcome, and if something is missing for integration, just let me know.

Requirements
kubectx and kubens from https://github.com/ahmetb/kubectx in PATH

Configuration

  "k8s": {
    "ltrim": bool,
    "rtrim": bool,
    "symbol": bool,
    "max_context": number,
    "max_namespace": number,
    "colorize": bool,
    "colorize_symbol": bool
  }

ltrim, rtrim: do not add space at left or right (compatibility with some theme mods)

symbol: show k8s symbol

max_context, max_namespace: cut with an ellipsis context or namespace, use 0 to supress output

colorize, colorize_symbol: auto-colorize based on the information string

Theme
K8S_FG = 57
K8S_BG = 7
K8S_SYMBOL_FG = 57

3coma3 added 3 commits July 15, 2023 03:15
I added this to avoid making mistakes when using multiple contexts, hope
you find it useful.

Requirements
  kubectx and kubens from https://github.com/ahmetb/kubectx in PATH

Configuration

  "k8s": {
    "ltrim": bool,
    "rtrim": bool,
    "symbol": bool,
    "max_context": number,
    "max_namespace": number,
    "colorize": bool,
    "colorize_symbol": bool
  },

ltrim, rtrim: do not add space at left or right (compatibility with some
theme mods)

symbol: show k8s symbol

max_context, max_namespace: cut with an ellipsis context or namespace,
use 0 to supress output

colorize, colorize_symbol: auto-colorize based on the information string

Theme
  K8S_FG = 57
  K8S_BG = 7
  K8S_SYMBOL_FG = 57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant