Config file ~/.kube/color.yaml
In addition to environment variables, you can configure kubecolor via
a dedicated config file: ~/.kube/color.yaml
The “!color
” & “!color-list
”
YAML tags are only included here in the documentation to signal what data type
is used.
The tags should not be present in your config file.
Example file (the values shows the default values):
# yaml-language-server: $schema=https://github.com/kubecolor/kubecolor/raw/main/config-schema.json
kubectl: kubectl # path to kubectl executablepreset: dark # color theme presetobjFreshThreshold: 0 # ages below this uses theme.data.durationfresh coloringpaging: never # whether to pipe supported subcommands to a pager ("auto" or "never")pager: # the command to use as pager; default uses $PAGER, less, or more
# Color theme optionstheme: base: # general color for when things are bad danger: !color red
# general color for when things are informational info: !color white
# general color for when things are less relevant muted: !color gray:italic
# general color for when things are focus primary: !color magenta
# general color for when things are secondary focus secondary: !color cyan
# general color for when things are good success: !color green
# general color for when things are wrong warning: !color yellow
# general color for keys key: !color-list # default = [$theme.base.secondary])
# default when no specific mapping is found for the command default: !color green
shell: # used on comments, e.g `# this is a comment` comment: !color # default = $theme.base.muted
# used on commands, e.g `kubectl` or `echo` command: !color # default = $theme.base.success
# used on arguments, e.g `get pods` in `kubectl get pods` arg: !color # default = $theme.base.info
# used on flags, e.g `--watch` in `kubectl get pods --watch` flag: !color # default = $theme.base.secondary
data: # used for the key key: !color-list # default = $theme.base.key
# used when value is a string string: !color # default = $theme.base.info
# used when value is true "true": !color # default = $theme.base.success
# used when value is false "false": !color # default = $theme.base.danger
# used when the value is a number number: !color # default = $theme.base.primary
# used when the value is null, nil, or none "null": !color # default = $theme.base.muted
# used when the value is a quantity, e.g "100m" or "5Gi" quantity: !color # default = $theme.data.number
# used when the value is a duration, e.g "12m" or "1d12h" duration: !color
# color used when the time value is under a certain delay durationFresh: !color # default = $theme.base.success
ratio: # used for "0/0" zero: !color # default = $theme.base.muted
# used for "n/n", e.g "1/1" equal: !color
# used for "n/m", e.g "0/1" unequal: !color # default = $theme.base.warning
status: # used in status keywords, e.g "Running", "Ready" success: !color # default = $theme.base.success
# used in status keywords, e.g "Terminating" warning: !color # default = $theme.base.warning
# used in status keywords, e.g "Failed", "Unhealthy" error: !color # default = $theme.base.danger
table: # used on table headers header: !color # default = $theme.base.info
# used on table columns when no other coloring applies such as status or duration coloring. The multiple colors are cycled based on column ID, from left to right. columns: !color-list # default = [$theme.base.info / $theme.base.secondary])
stderr: # e.g when text contains "error" error: !color # default = $theme.base.danger
# used on table output like "No resources found" noneFound: !color # default = $theme.data.null
# used on the namespace name of "No resources found in my-ns namespace" noneFoundNamespace: !color # default = $theme.data.string
# *deprecated: this field is no longer used (since v0.4.0)* default: !color
apply: # used on "deployment.apps/foo created" created: !color # default = $theme.base.success
# used on "deployment.apps/bar configured" configured: !color # default = $theme.base.warning
# used on "deployment.apps/quux unchanged" unchanged: !color # default = $theme.base.primary
# used on "deployment.apps/quux serverside-applied" serverside: !color # default = $theme.base.warning
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.base.secondary
# used when outputs unknown format fallback: !color # default = $theme.base.success
create: # used on "deployment.apps/foo created" created: !color # default = $theme.base.success
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.success
delete: # used on "deployment.apps "nginx" deleted" deleted: !color # default = $theme.base.danger
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.danger
describe: # used on keys. The multiple colors are cycled based on indentation. key: !color-list # default = $theme.base.key
drain: # used on "node/my-worker-node-01 cordoned" cordoned: !color # default = $theme.base.primary
# used on "evicting pod my-namespace/my-pod" evictingPod: !color # default = $theme.base.muted
# used on "pod/my-pod evicted" evicted: !color # default = $theme.base.warning
# used on "node/my-worker-node-01 drained" drained: !color # default = $theme.base.success
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.warning
explain: # used on keys. The multiple colors are cycled based on indentation. key: !color-list # default = $theme.base.key
# used on the trailing "-required-" string required: !color # default = $theme.base.danger
expose: # used on "deployment.apps/foo created" exposed: !color # default = $theme.base.primary
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.primary
options: # e.g "--kubeconfig" flag: !color # default = $theme.base.secondary
patch: # used on "deployment.apps/foo patched" patched: !color # default = $theme.base.warning
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.warning
rollout: # used on "deployment.apps/foo rolled back" rolledBack: !color # default = $theme.base.warning
# used on "deployment.apps/foo paused" paused: !color # default = $theme.base.primary
# used on "deployment.apps/foo resumed" resumed: !color # default = $theme.base.secondary
# used on "deployment.apps/foo restarted" restarted: !color # default = $theme.base.warning
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.warning
scale: # used on "deployment.apps/foo scaled" scaled: !color # default = $theme.base.warning
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.warning
uncordon: # used on "node/my-worker-node-01 uncordoned" uncordoned: !color # default = $theme.base.secondary
# used on "(dry run)" and "(server dry run)" dryRun: !color # default = $theme.apply.dryrun
# used when outputs unknown format fallback: !color # default = $theme.base.warning
version: # used on the key key: !color-list # default = $theme.base.key
help: # e.g "Examples:" or "Options:" header: !color # default = $theme.table.header
# e.g "--kubeconfig" flag: !color # default = $theme.base.secondary
# Flag descripion under "Options:" heading flagDesc: !color # default = $theme.base.info
# e.g `[https://example.com]` url: !color # default = $theme.base.secondary
# Fallback text color text: !color # default = $theme.base.info
logs: key: !color-list # default = $theme.data.key
# Used on quoted strings that are not part of a `key="value"` quotedString: !color # default = $theme.data.string
date: !color # default = $theme.base.muted
sourceRef: !color # default = $theme.base.muted
guid: !color # default = $theme.base.muted
severity: trace: !color # default = $theme.base.muted
debug: !color # default = $theme.base.muted
info: !color # default = $theme.base.success
warn: !color # default = $theme.base.warning
error: !color # default = $theme.base.danger
fatal: !color # default = $theme.base.danger
panic: !color # default = $theme.base.danger
diff: # used on added lines added: !color # default = $theme.base.success
# used on removed lines removed: !color # default = $theme.base.danger
# used on unchanged lines unchanged: !color # default = $theme.base.muted
You can also override the path of the config file using the KUBECOLOR_CONFIG
environment variable:
# Defaultexport KUBECOLOR_CONFIG="$HOME/.kube/color.yaml"
# But you can override it to someplace elseexport KUBECOLOR_CONFIG="$HOME/.config/kubecolor.yaml"