Custom kubectl or OpenShift CLI
Sometimes, you may want to specify which command to use as kubectl
internally in kubecolor. For example, when you want to use a versioned-kubectl
kubectl.1.19, you can do that by an environment variable or config field:
export KUBECOLOR_KUBECTL="kubectl.1.19"kubectl: kubectl.1.19The config defaults to kubectl.
OpenShift
Section titled “OpenShift”This feature can be used to use kubecolor with the OpenShift CLI (oc) as well:
export KUBECOLOR_KUBECTL="oc"kubectl: ocThen you can set oc to be an alias for kubecolor:
alias oc="kubecolor"Alternatively, instead of using the config, you can set the oc alias
to also set the environment variable:
alias oc="env KUBECOLOR_KUBECTL=oc kubecolor"