Config file ~/.kube/color.yaml
In addition to environment variables, you can configure kubecolor via
a dedicated config file: ~/.kube/color.yaml
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: info: white # (color) general color for when things are informational primary: magenta # (color) general color for when things are focus secondary: cyan # (color) general color for when things are secondary focus success: green # (color) general color for when things are good warning: yellow # (color) general color for when things are wrong danger: red # (color) general color for when things are bad muted: gray:italic # (color) general color for when things are less relevant key: hicyan / cyan # (color[]) general color for keys (fallback to [theme.base.secondary]) default: green # (color) default when no specific mapping is found for the command shell: comment: gray:italic # (color) used on comments, e.g `# this is a comment` (fallback to theme.base.muted) command: green # (color) used on commands, e.g `kubectl` or `echo` (fallback to theme.base.success) arg: white # (color) used on arguments, e.g `get pods` in `kubectl get pods` (fallback to theme.base.info) flag: cyan # (color) used on flags, e.g `--watch` in `kubectl get pods --watch` (fallback to theme.base.secondary) data: key: hicyan / cyan # (color[]) used for the key (fallback to theme.base.key) string: hiyellow # (color) used when value is a string (fallback to theme.base.info) "true": green # (color) used when value is true (fallback to theme.base.success) "false": red # (color) used when value is false (fallback to theme.base.danger) number: magenta # (color) used when the value is a number (fallback to theme.base.primary) "null": gray:italic # (color) used when the value is null, nil, or none (fallback to theme.base.muted) quantity: magenta # (color) used when the value is a quantity, e.g "100m" or "5Gi" (fallback to theme.data.number) duration: # (color) used when the value is a duration, e.g "12m" or "1d12h" durationFresh: green # (color) color used when the time value is under a certain delay (fallback to theme.base.success) ratio: zero: gray:italic # (color) used for "0/0" (fallback to theme.base.muted) equal: # (color) used for "n/n", e.g "1/1" unequal: yellow # (color) used for "n/m", e.g "0/1" (fallback to theme.base.warning) status: success: green # (color) used in status keywords, e.g "Running", "Ready" (fallback to theme.base.success) warning: yellow # (color) used in status keywords, e.g "Terminating" (fallback to theme.base.warning) error: red # (color) used in status keywords, e.g "Failed", "Unhealthy" (fallback to theme.base.danger) table: header: bold # (color) used on table headers (fallback to theme.base.info) columns: white / cyan # (color[]) 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. (fallback to [theme.base.info / theme.base.secondary]) stderr: error: red # (color) e.g when text contains "error" (fallback to theme.base.danger) noneFound: gray:italic # (color) used on table output like "No resources found" (fallback to theme.data.null) noneFoundNamespace: hiyellow # (color) used on the namespace name of "No resources found in my-ns namespace" (fallback to theme.data.string) default: # (color) *deprecated: this field is no longer used (since v0.4.0)* apply: created: green # (color) used on "deployment.apps/foo created" (fallback to theme.base.success) configured: yellow # (color) used on "deployment.apps/bar configured" (fallback to theme.base.warning) unchanged: magenta # (color) used on "deployment.apps/quux unchanged" (fallback to theme.base.primary) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.base.secondary) fallback: green # (color) used when outputs unknown format (fallback to theme.base.success) create: created: green # (color) used on "deployment.apps/foo created" (fallback to theme.base.success) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: green # (color) used when outputs unknown format (fallback to theme.base.success) delete: deleted: red # (color) used on "deployment.apps "nginx" deleted" (fallback to theme.base.danger) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: red # (color) used when outputs unknown format (fallback to theme.base.danger) describe: key: hicyan / cyan # (color[]) used on keys. The multiple colors are cycled based on indentation. (fallback to theme.base.key) drain: cordoned: magenta # (color) used on "node/my-worker-node-01 cordoned" (fallback to theme.base.primary) evictingPod: gray:italic # (color) used on "evicting pod my-namespace/my-pod" (fallback to theme.base.muted) evicted: yellow # (color) used on "pod/my-pod evicted" (fallback to theme.base.warning) drained: green # (color) used on "node/my-worker-node-01 drained" (fallback to theme.base.success) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: yellow # (color) used when outputs unknown format (fallback to theme.base.warning) explain: key: hicyan / cyan # (color[]) used on keys. The multiple colors are cycled based on indentation. (fallback to theme.base.key) required: red # (color) used on the trailing "-required-" string (fallback to theme.base.danger) expose: exposed: magenta # (color) used on "deployment.apps/foo created" (fallback to theme.base.primary) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: magenta # (color) used when outputs unknown format (fallback to theme.base.primary) options: flag: cyan # (color) e.g "--kubeconfig" (fallback to theme.base.secondary) patch: patched: yellow # (color) used on "deployment.apps/foo patched" (fallback to theme.base.warning) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: yellow # (color) used when outputs unknown format (fallback to theme.base.warning) rollout: rolledBack: yellow # (color) used on "deployment.apps/foo rolled back" (fallback to theme.base.warning) paused: magenta # (color) used on "deployment.apps/foo paused" (fallback to theme.base.primary) resumed: cyan # (color) used on "deployment.apps/foo resumed" (fallback to theme.base.secondary) restarted: yellow # (color) used on "deployment.apps/foo restarted" (fallback to theme.base.warning) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: yellow # (color) used when outputs unknown format (fallback to theme.base.warning) scale: scaled: yellow # (color) used on "deployment.apps/foo scaled" (fallback to theme.base.warning) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: yellow # (color) used when outputs unknown format (fallback to theme.base.warning) uncordon: uncordoned: cyan # (color) used on "node/my-worker-node-01 uncordoned" (fallback to theme.base.secondary) dryRun: cyan # (color) used on "(dry run)" and "(server dry run)" (fallback to theme.apply.dryrun) fallback: yellow # (color) used when outputs unknown format (fallback to theme.base.warning) version: key: hicyan / cyan # (color[]) used on the key (fallback to theme.base.key) help: header: bold # (color) e.g "Examples:" or "Options:" (fallback to theme.table.header) flag: cyan # (color) e.g "--kubeconfig" (fallback to theme.base.secondary) flagDesc: white # (color) Flag descripion under "Options:" heading (fallback to theme.base.info) url: cyan # (color) e.g `[https://example.com]` (fallback to theme.base.secondary) text: white # (color) Fallback text color (fallback to theme.base.info) logs: key: hicyan / cyan # (color[]) (fallback to theme.data.key) quotedString: hiyellow # (color) Used on quoted strings that are not part of a `key="value"` (fallback to theme.data.string) date: gray:italic # (color) (fallback to theme.base.muted) sourceRef: gray:italic # (color) (fallback to theme.base.muted) guid: gray:italic # (color) (fallback to theme.base.muted) severity: trace: gray:italic # (color) (fallback to theme.base.muted) debug: gray:italic # (color) (fallback to theme.base.muted) info: green # (color) (fallback to theme.base.success) warn: yellow # (color) (fallback to theme.base.warning) error: red # (color) (fallback to theme.base.danger) fatal: red # (color) (fallback to theme.base.danger) panic: red # (color) (fallback to theme.base.danger)
You can also override the path of the config file using the KUBECOLOR_CONFIG
environment variable:
export KUBECOLOR_CONFIG="$HOME/.config/kubecolor.yaml"